Skip to content
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

test(binary.wast): adjust br_table length test to work with streaming validation #1715

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

rvagg
Copy link
Contributor

@rvagg rvagg commented Jan 1, 2024

Current implementation fails on streaming validation due to interpreting 0x020x0b as block with type 11 which doesn't exist; so add enough types such that 0x0b resolves to a valid one, thereby passing validation and erroring at the expected state.

This was previously reported in #1355 but never fixed, and I've just discovered it for myself.

Suggestions for making this more realistic or safe welcome! I'm a bit concerned about adding so many duplicate types in here but I don't believe that's illegal according to spec. My first pass at this changed the first 0x0b to an 0x00 but that breaks the realism a bit too much since you need the 3 breaks and the wild 0x00 makes no sense. The test is trying to get at the br_table having a missing byte.

current implementation fails on streaming validation due to interpreting
0x020x0b as block with type 11 which doesn't exist; so add enough types
such that 0x0b resolves to a valid one, thereby passing validation and
erroring at the expected state.
Copy link
Member

@rossberg rossberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@rossberg rossberg merged commit bad4c2e into WebAssembly:main Jan 3, 2024
1 check passed
dhil added a commit to wasmfx/specfx that referenced this pull request Jan 25, 2024
* [test] Adjust br_table length test to avoid wrong failure (WebAssembly#1715)

* [spec] Fix extmul & extadd execution (WebAssembly#1716)

* [interpreter] Add dune dependencies (WebAssembly#1717)

* Revert "[interpreter] Add dune dependencies (WebAssembly#1717)"

This reverts commit 44ed035.

* [interpreter/test] Fix inconsistent use of float values in `spectest` (WebAssembly#1718)

* [spec] Fix operand order in reduction of shape.replace_lane (WebAssembly#1721)

* [spec] Fix sx to be sx? in reduction of vcvtop_zero (WebAssembly#1720)

---------

Co-authored-by: Rod Vagg <rod@vagg.org>
Co-authored-by: 702fbtngus <79245586+702fbtngus@users.noreply.github.com>
Co-authored-by: Muqiu Han (韩暮秋) <muqiu-han@outlook.com>
Co-authored-by: Andreas Rossberg <rossberg@mpi-sws.org>
Co-authored-by: Dongjun Youn / 윤동준 <f52985@gmail.com>
Co-authored-by: Hoseong Lee <101983402+HoseongLee@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants