Add support for non-nullable tables and init expressions#8405
Add support for non-nullable tables and init expressions#8405tlively merged 48 commits intoWebAssembly:mainfrom
Conversation
I don't see these changes in shared.py, can we add them? |
Uses American spelling and clarify that the breaking change is only in the C API Co-authored-by: Steven Fontanella <steven.fontanella@gmail.com>
This reverts commit a33eae8. Reason for revert: storing 0x40 as a uint32_t breaks comparison with the int32_t
Might not work... pushing so CI can check
Also update expected elem section output due to the module now having two tables.
|
Looks good from my side. I'll let @tlively have the final review. Thanks for the contribution! |
|
@stevenfontanella thank you for such a thorough review! |
|
Fuzzer support has been added (with room for improvements still, but it's already thrown up a bug). That's caused a test to fail though, with |
…on-nullable-table
Yes and yes 👍 |
|
I've run the fuzzer 10159 times with no problems, so hopefully everything that needs to be updated has been. |
stevenfontanella
left a comment
There was a problem hiding this comment.
LGTM, will let Thomas have the last look!
tlively
left a comment
There was a problem hiding this comment.
LGTM % a few last nits. Thanks again for working on this!
New versions were released between the initial changelog writing in WebAssembly#8405 and me merging in upstream into my branch, so the changelog entry got merged into the v127 entry rather than the current trunk. This fixes that.
Resolves #5628
Adds support for non-nullable tables with init expressions. I'm not totally sure how I should go about adding new tests, but manual test cases are below. I have also unignored previously ignored spec tests
instance.wast,ref_is_null.wast,table.wast,i31.wast,global.wastwhich now all pass. I have also changed the reason for ignoringarray.wastas it does not (and has not in the past, AFAICT) rely on non-nullable table types.This introduces a breaking change in the C api, as it adds an extra argument to
addTable. Is this ok? Should a new method be added instead? (e.g.addTableWithInit?)Manual tests
click to expand
The validation ones might overlap with the spec tests. Unchecked boxes indicate tests that currently fail.Correctly fails with
[wasm-validator error in module] unexpected false: tables with non-nullable types require an initializer expression, on tableCorrectly fails with
[wasm-validator error in module] init expression must be a subtype of the table type, on (i32.const 0)Correctly fails with
[wasm-validator error in module] init expression must be a subtype of the table type, on (i32.const 0)wasm-optdoesn't remove init expr as dead codeTODO:
dummy PR for CI tests to run automatically: pufferfish101007#2