-
Notifications
You must be signed in to change notification settings - Fork 745
Implement return_call_ref, ref.as_non_null, br_on_[non_]null instructions #2567
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
base: main
Are you sure you want to change the base?
Conversation
Which proposal are these instruction part of? |
Thank you for checking the patch. These are the instructions: I am working on function references phase 5 proposal at the moment, which is requirement for the (latest) GC proposal. The work is split into two parts: #2562 adds the concepts of This patch adds the instructions from the proposal. This is the generic testsuite, also used by wabt: My aim is to make all test pass in this directory. |
92898bd
to
bce48df
Compare
What can I do with this test on s390x:
The test is also slow on x86. It does a lot of recursion. I did not write the test, it is a spec test. |
you might be able to add |
bce48df
to
758858b
Compare
Great idea! Thanks it worked! |
758858b
to
ef7290e
Compare
1184506
to
10500a7
Compare
Ok the fuzzer using this patch found another issue in the code, which is not related to this patch. Example code: The compiled code is
With a hexeditor I changed the 0x41 (i32.const) to 0x11 (call_indirect). Then I run objdump: wasm-objdump: .../wabt/wabt/src/binary-reader-objdump.cc:661: void wabt::{anonymous}::BinaryReaderObjdumpDisassemble::LogOpcode(const char*, ...): Assertion `in_function_body' failed. The reason is that init expressions are not validated by objdump. If I change 0x41 to 0x45 ( What shall we do? |
My suggestion: I suspect objdump does not validate the code intentionally, just dumps it. Then validation related sanity checks does not make sense, so maybe setting |
Fixes the fuzzer bug in #2567 I noticed all objdump logs are guarded by `if (!in_function_body)`. The code crashes without this check.
ec09f77
to
69054bf
Compare
13fc7b7
to
d03887c
Compare
2c092e7
to
126985f
Compare
ab7cd3c
to
c652aee
Compare
Support named references for globals, locals, tables, elems Support named references for call_ref, ref_null Extend Var variables with an optional type field
c652aee
to
5855654
Compare
Depends on #2562
Another 1000 lines addition. Depends on the previous work. Currently implements 3 opcodes, but I might add the remaining opcode (return_call_ref).