Skip to content

Commit

Permalink
Add tuple.drop validation (#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 Dec 19, 2023
1 parent 4c53361 commit eb5666e
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 eb5666e

Please sign in to comment.