Skip to content

Failed parse for 'attempted pop from empty stack / beyond block start boundary' on non-empty stack #6268

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

Closed
aaronmunsters opened this issue Feb 1, 2024 · 2 comments

Comments

@aaronmunsters
Copy link

I receive a parse error using wasm-opt v116.
The error reports the issue 'attempted pop from empty stack / beyond block start boundary', however the stack is non-empty.
The same input program passes wat2wasm and wasm-validate.

Example illustrating what goes wrong:

$ cat instrumented_input.wat

yields

(module
  (func $a (result i32)
    i32.const 0
    i32.const 0
    if (param i32) (result i32)
      drop
      i32.const 0
    else
      drop
      i32.const 0
    end))

however:

# Turn Wat into Wasm
$ wat2wasm instrumented_input.wat -o instrumented_input.wasm

# Validate
$ wasm-validate instrumented_input.wasm # No problem

# Attempt to use wasm-opt
$ wasm-opt --version
wasm-opt version 116
$ wasm-opt instrumented_input.wasm
[parse exception: attempted pop from empty stack / beyond block start boundary at 40 (at 0:40)]
Fatal: error parsing wasm (try --debug for more info)
@kripken
Copy link
Member

kripken commented Feb 1, 2024

if (param i32) (result i32)

Binaryen does not yet support input params to ifs (and other control flow structures).

@tlively
Copy link
Member

tlively commented Apr 15, 2024

Closing in favor of #6407.

@tlively tlively closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
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

No branches or pull requests

3 participants