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

Valid if with result types and unreachable code fails to validate #90

Closed
fitzgen opened this issue Aug 22, 2020 · 0 comments · Fixed by #91
Closed

Valid if with result types and unreachable code fails to validate #90

fitzgen opened this issue Aug 22, 2020 · 0 comments · Fixed by #91
Labels
wasmparser Related to the binary format of WebAssembly (wasmparser)

Comments

@fitzgen
Copy link
Member

fitzgen commented Aug 22, 2020

test.wasm.gz

(module
  (type (;0;) (func (result i32 i32)))
  (func (;0;) (type 0) (result i32 i32)
    global.get 0
    call 2
    unreachable
    select
    if (result i32 i32)  ;; label = @1
      unreachable
    else
      unreachable
    end)
  (func (;1;) (type 0) (result i32 i32)
    unreachable)
  (func (;2;) (type 0) (result i32 i32)
    unreachable)
  (table (;0;) 0 funcref)
  (global (;0;) (mut i32) (i32.const 808661811)))

Requires multi-value to be enabled.

This fails to validate with the error:

type mismatch: stack size does not match block type (at offset 113)
@fitzgen fitzgen added the wasmparser Related to the binary format of WebAssembly (wasmparser) label Aug 22, 2020
dhil added a commit to dhil/wasm-tools that referenced this issue May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasmparser Related to the binary format of WebAssembly (wasmparser)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant