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::OnCallIndirectExpr #1413

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

Comments

@pventuzelo
Copy link

Hey,

During fuzzing I triggered this assertion failure using wasm2wat --enable-all:

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

Related code (line 725):

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

Reproducing

Download: assert_OnCallIndirectExpr_wabt.zip

Run:

./bin/wasm2wat --enable-all assert_OnCallIndirectExpr_wabt.wasm -o /dev/null
wasm2wat: /home/scop/Documents/wabt/src/binary-reader-ir.cc:725: virtual wabt::Result wabt::(anonymous namespace)::BinaryReaderIR::OnCallIndirectExpr(wabt::Index, wabt::Index): Assertion `sig_index < module_->types.size()' failed.
[1]    10570 abort (core dumped)  ./bin/wasm2wat --enable-all assert_OnCallIndirectExpr_wabt.wasm -o /dev/null
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_OnCallIndirectExpr_wabt.wasm 
assert_OnCallIndirectExpr_wabt.wasm:0000075: error: function type variable out of range: 16 (max 1)

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