Skip to content

Commit eb5666e

Browse files
authored
Add tuple.drop validation (#6186)
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).
1 parent 4c53361 commit eb5666e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/wasm/wasm-validator.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2123,6 +2123,11 @@ void FunctionValidator::visitDrop(Drop* curr) {
21232123
curr->value->type == Type::unreachable,
21242124
curr,
21252125
"can only drop a valid value");
2126+
if (curr->value->type.isTuple()) {
2127+
shouldBeTrue(getModule()->features.hasMultivalue(),
2128+
curr,
2129+
"Tuples drops are not allowed unless multivalue is enabled");
2130+
}
21262131
}
21272132

21282133
void FunctionValidator::visitReturn(Return* curr) {

0 commit comments

Comments
 (0)