-
Notifications
You must be signed in to change notification settings - Fork 58
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
add option for reference-types #124
base: main
Are you sure you want to change the base?
Conversation
only enables the wasmtime feature, which allows initializing Modules that were compiled with newer llvm versions but don't actually use reference_types Disabled by default
I tried with my own code and could successfully initialize a Module that errors without the option. Since there is nothing actually implemented, I set the default to false and keep the feature disabled for fuzzers, I hope that is correct |
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.
Can you extend the wasm_validate
function to disallow the following reference-types instructions:
ref.null
ref.is_null
- the typed variant of
select
ref.func
table.get
table.set
table.size
table.grow
table.fill
table.init
table.copy
?
And also please add the following tests:
- a table-modifying instruction is used when reference-types are enabled, but the wasm is still rejected
- reference-types are enabled and an instruction encoding that requires reference-types is used for an instruction which doesn't actually mutate tables or manipulate references, and therefore wizer succeeds (for example, a
call_indirect
using a non-zero table index)
Thanks!
Co-authored-by: Nick Fitzgerald <fitzgen@gmail.com>
b1921f0
to
5fca98b
Compare
I hope I added everything |
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.
Thanks! Two minor things and then we can merge this.
I hope I did it right, this seems to use the new call_indirect and the second table |
as expected the test now goes red if I disable reference-types, so it uses the right call now :) Edit: actually that statement is not neccessarily true, with reference types disabled it already rejects the existence of a second table, but still, the fact that call_indirect finds the second table means it should be the new call_indirect |
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.
Thanks!
only enables the wasmtime feature, which allows initializing Modules that were compiled with newer llvm versions but don't actually use reference-types