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

[wasm2wat] Assertion failure in BinaryReaderIR::OnReturnCallIndirectExpr #1414

Closed
pventuzelo opened this issue May 10, 2020 · 1 comment
Closed

Comments

@pventuzelo
Copy link

pventuzelo commented May 10, 2020

Hey,

Similar assertion failure than #1413 but in another expression.

Assertion `sig_index < module_->types.size()' failed.

Related code (line 737):

Result BinaryReaderIR::OnReturnCallIndirectExpr(Index sig_index, Index table_index) {
assert(sig_index < module_->types.size());
auto expr = MakeUnique<ReturnCallIndirectExpr>();

Reproducing

Download: assert_OnReturnCallIndirectExpr_wabt.zip

Run:

./bin/wasm2wat --enable-all assert_OnReturnCallIndirectExpr_wabt.wasm -o /dev/null
wasm2wat: /home/scop/Documents/wabt/src/binary-reader-ir.cc:737: virtual wabt::Result wabt::(anonymous namespace)::BinaryReaderIR::OnReturnCallIndirectExpr(wabt::Index, wabt::Index): Assertion `sig_index < module_->types.size()' failed.
[1]    13148 abort (core dumped)  ./bin/wasm2wat --enable-all assert_OnReturnCallIndirectExpr_wabt.wasm -o
binji added a commit that referenced this issue May 11, 2020
These assertions check to see whether the `sig_index` (i.e. the function
type) are in bounds. But this is the responsibility of the validator,
not the binary reader.

Fixes issues #1413 and #1414.
binji added a commit that referenced this issue May 12, 2020
These assertions check to see whether the `sig_index` (i.e. the function
type) are in bounds. But this is the responsibility of the validator,
not the binary reader.

Fixes issues #1413 and #1414.
@pventuzelo
Copy link
Author

fix confirmed

$ wasm2wat --enable-all assert_OnReturnCallIndirectExpr_wabt.wasm 
0000072: error: unexpected opcode: 0xc5

keithw added a commit to Mem2019/wabt that referenced this issue Sep 17, 2022
The returncallindirect regression is identical to WebAssembly#1414,
but in the interpreter
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

1 participant