Page MenuHomePhabricator

eo_parser: fix unreachable code
ClosedPublic

Authored by herb on Apr 23 2019, 10:14 PM.

Details

Summary

fix unreachable code for kw_enum case in parse_unit function

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
herb created this revision.Apr 23 2019, 10:14 PM
herb requested review of this revision.Apr 23 2019, 10:14 PM
q66 requested changes to this revision.Apr 23 2019, 11:55 PM

The goto is unnecessary, syntax error means a long jump

This revision now requires changes to proceed.Apr 23 2019, 11:55 PM
herb added a comment.Apr 24 2019, 1:02 AM
In D8696#158404, @q66 wrote:

The goto is unnecessary, syntax error means a long jump

@q66
Hi, you mean these codes are intended?
but actually the following codes are not reachable.
2198: if (is_enum)
2199: eo_lexer_syntax_error(ls, "enums cannot have @free");

q66 added a comment.Apr 24 2019, 2:14 AM

No, it's not intended, but all you need to do is simply remove the first is_enum check and leave the second one where it is.

herb updated this revision to Diff 21594.Apr 24 2019, 2:41 AM

update code

herb added a comment.Apr 24 2019, 2:43 AM
In D8696#158431, @q66 wrote:

No, it's not intended, but all you need to do is simply remove the first is_enum check and leave the second one where it is.

@q66
I modified the code following your comment :)

q66 accepted this revision.Apr 24 2019, 2:56 AM
This revision is now accepted and ready to land.Apr 24 2019, 2:56 AM
This revision was automatically updated to reflect the committed changes.