-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: branch stmts #3043
base: master
Are you sure you want to change the base?
fix: branch stmts #3043
Conversation
5f5172c
to
c5dcb0a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3043 +/- ##
==========================================
- Coverage 63.77% 63.73% -0.05%
==========================================
Files 548 548
Lines 78681 78695 +14
==========================================
- Hits 50180 50157 -23
- Misses 25117 25148 +31
- Partials 3384 3390 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
||
if n.GetAttribute(ATTR_LAST_BLOCK_STMT) != true { | ||
// no more clause after the one executed, this is not allowed | ||
panic("fallthrough statement out of place") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any test targeting this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several tests. grep for fallthrough statement out of place
ATTR_LOOP_DEFINES GnoAttribute = "ATTR_LOOP_DEFINES" // []Name defined within loops. | ||
ATTR_LOOP_USES GnoAttribute = "ATTR_LOOP_USES" // []Name loop defines actually used. | ||
ATTR_SHIFT_RHS GnoAttribute = "ATTR_SHIFT_RHS" | ||
ATTR_LAST_BLOCK_STMT GnoAttribute = "ATTR_LAST_BLOCK_STMT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a better name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am open to suggestions
Adds validation for
break
,continue
andfallthrough
to disallow invalid code.Moves existing validation from the runtime to the preprocessor.
Closes #2973