-
Notifications
You must be signed in to change notification settings - Fork 379
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(gnovm): fix max names in block check #2645
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2645 +/- ##
=======================================
Coverage 60.14% 60.15%
=======================================
Files 560 560
Lines 74738 74738
=======================================
+ Hits 44950 44957 +7
+ Misses 26400 26394 -6
+ Partials 3388 3387 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ 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.
LGTM
good catch, I'll be pedantic but do you think you can add a test that checks for this panic happening when we add the could be a unit test, or a code-generated filetest. |
Sure, I've added a test for this. |
I noticed this while reviewing #2429. The previous conditional could never evaluate to true:
if (1<<16 - 1) < sb.NumNames {
.sb.NumNames
is auint16
and the value it is being compared to,1<<16 - 1
is the max uint16 value, so it is impossible the the number of names to be greater than this value. Instead, we should check to see if the current number of names is the maximum value and panic if this is the case.Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description