Repository navigation
Fix checking of ref.func index declarations - #1894
Conversation
The validation was overly strict for ref.func index uses. In the spec, the ref index just needs to appear in "the set of function indices occurring in the module, except in its functions or start function." which includes uses in the global and export sections. Fixes issue WebAssembly#1893
|
This looks right to me (you may have seen #1888 where I tried to work around this). What do you think about https://github.com/WebAssembly/wabt/blob/main/test/spec/unreached-valid.txt , which seems to be the other test with failed validation? |
sbc100
left a comment
There was a problem hiding this comment.
Thanks for working on this. I do wonder if we are lacking in test coverage (in the spec repo) given that the overall number of passing/failing tests stayed the same here (only the specific outout text changed).
The problem there seems to be that the validation semantics of |
Thanks for the feedback, I think I've addressed the comments. Re: tests, I think the issue here is that a spec test command like |
OK, that sounds like maybe something we should fix but is not related to this change. Are you saying that if wabt can fail to validate such a |
Right, because just a Just adding a |
|
#1895 is my attempt to address this with the smallest possible change (bombing out on error instead of adding TallyCommand and updating all tests). |
The validation was overly strict for ref.func index uses. In the spec, the ref index just needs to appear in
(https://webassembly.github.io/spec/core/valid/modules.html#valid-module)
which includes uses in the global and export sections. There were some test failures in the spec tests that were fixed by this, so the PR also changes test expectations.
Fixes issue #1893