diff options
author | Alon Zakai <azakai@google.com> | 2023-12-19 13:30:43 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-19 13:30:43 -0800 |
commit | eb5666eeb0a2b74314e1aaf27e57193cb8fd4a99 (patch) | |
tree | ef6a8e9a8a5dd8cdcd7d38945fd9012a3747328c /src | |
parent | 4c53361b205ad30acc05136388b789296a4180f7 (diff) | |
download | binaryen-eb5666eeb0a2b74314e1aaf27e57193cb8fd4a99.tar.gz binaryen-eb5666eeb0a2b74314e1aaf27e57193cb8fd4a99.tar.bz2 binaryen-eb5666eeb0a2b74314e1aaf27e57193cb8fd4a99.zip |
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).
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm/wasm-validator.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wasm/wasm-validator.cpp b/src/wasm/wasm-validator.cpp index c1b4a86e7..8c165b700 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -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) { |