-
Notifications
You must be signed in to change notification settings - Fork 34
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
Validate arity of labels in br_table #368
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #368 +/- ##
==========================================
+ Coverage 98.85% 98.86% +0.01%
==========================================
Files 42 42
Lines 12184 12320 +136
==========================================
+ Hits 12044 12180 +136
Misses 140 140 |
I will squash test commits before merging. |
chfast
approved these changes
Jun 3, 2020
lib/fizzy/parser_expr.cpp
Outdated
|
||
if (get_branch_arity(branch_frame) != default_branch_arity) | ||
throw validation_error{"br_table labels have inconsistent block result types"}; |
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.
Suggested change
throw validation_error{"br_table labels have inconsistent block result types"}; | |
throw validation_error{"br_table labels have inconsistent types"}; |
... as wabt is reporting this...
gumb0
force-pushed
the
validate-br-table
branch
2 times, most recently
from
June 3, 2020 12:25
e390f20
to
996a255
Compare
Changed error message and squashed test commits. |
Co-authored-by: Paweł Bylica <chfast@gmail.com>
Rebased. |
chfast
approved these changes
Jun 4, 2020
axic
approved these changes
Jun 4, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Required for #354.
There's a slight complication around loop's arity: turns out if there's loop in
br_table
labels, it's arity is considered always 0 (and thenbr_table
is valid only if all labels have arity 0).It's difficult to find clear confirmation of this in the spec, but spec tests cover it in this case https://github.com/WebAssembly/spec/blob/636b862b9c8a25ad65fb240fefd673e7f23bcdd0/test/core/br_table.wast#L1229-L1244