-
Notifications
You must be signed in to change notification settings - Fork 359
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: labels error handling #1877
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1877 +/- ##
==========================================
- Coverage 47.54% 45.06% -2.48%
==========================================
Files 388 464 +76
Lines 61242 68027 +6785
==========================================
+ Hits 29117 30658 +1541
- Misses 29686 34800 +5114
- Partials 2439 2569 +130 ☔ View full report in Codecov by Sentry. |
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.
Looks good 💯
I've left some nitties, otherwise we are good to go
Thank you for the fix 🙏
code: ` | ||
package test | ||
func main(){} | ||
func invalidLabel() { | ||
FirstLoop: | ||
for i := 0; i < 10; i++ { | ||
} | ||
for i := 0; i < 10; i++ { | ||
break FirstLoop | ||
} | ||
} | ||
`, | ||
output: `cannot find branch label "FirstLoop"`, | ||
}, |
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.
For next time, please place tests like these in gnovm/tests/files
. Goes for all tests which simply run some code and try to test the output or any panic, like these ones
If you're testing specific functions or doing unit tests, then they should go in gnolang
, but if they are tests which just run some code against the GnoVM then they should go there
fixes this
Added error handling on
TRANS_LEAVE
during preprocessing, for break and continue statements that have labels.