Skip to content

Commit

Permalink
Add tuple.drop validation (WebAssembly#6186)
Browse files Browse the repository at this point in the history
Without this fuzzer testcases fail if the initial content has a tuple.drop but multivalue
is disabled (then the initial content validates erroneously, and that content is remixed
into more content using multivalue which fails to validate).
  • Loading branch information
kripken authored and radekdoulik committed Jul 12, 2024
1 parent 00b0540 commit 77c34a1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wasm/wasm-validator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2123,6 +2123,11 @@ void FunctionValidator::visitDrop(Drop* curr) {
curr->value->type == Type::unreachable,
curr,
"can only drop a valid value");
if (curr->value->type.isTuple()) {
shouldBeTrue(getModule()->features.hasMultivalue(),
curr,
"Tuples drops are not allowed unless multivalue is enabled");
}
}

void FunctionValidator::visitReturn(Return* curr) {
Expand Down

0 comments on commit 77c34a1

Please sign in to comment.