-
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
Raise validation error if referring to unknown global or setting immutable global #351
Conversation
d253fcd
to
b1ec2cf
Compare
@@ -51,6 +51,9 @@ using TableIdx = uint32_t; | |||
// https://webassembly.github.io/spec/core/syntax/modules.html#syntax-memidx |
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.
BTW these links now go to 1.1 spec
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.
Do you want to open an issue/PR for us to direct-link to 1.0?
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.
Init expressions of globals need to be validated, too, but I would do that in another PR, as it seems a bit more complicated. |
Codecov Report
@@ Coverage Diff @@
## master #351 +/- ##
==========================================
+ Coverage 98.84% 98.86% +0.01%
==========================================
Files 40 40
Lines 11643 11779 +136
==========================================
+ Hits 11509 11645 +136
Misses 134 134 |
@axic This is ready, please review |
Co-authored-by: Alex Beregszaszi <alex@rtfs.hu>
@@ -74,5 +74,13 @@ struct Module | |||
{ | |||
return !memorysec.empty() || !imported_memory_types.empty(); | |||
} | |||
|
|||
bool is_global_mutable(GlobalIdx idx) const noexcept |
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.
Hmm, shouldn't we have a unit test for 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.
For the sake of progress I'm merging this, but perhaps we should add unit tests for each module helper in a new PR>
Globals validation is poorly covered by spec tests, I added some cases to "to upstream" list |
No description provided.