diff options
author | Alon Zakai <azakai@google.com> | 2023-06-08 17:07:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-08 17:07:28 -0700 |
commit | 7dc6147ffad3cd13b711a7192b8fb9d234bc914b (patch) | |
tree | 3868963f92fae6bbc97fc71f4518068732adfcee | |
parent | e11abbe94503c2a592a29cd297880f0852d5dd89 (diff) | |
download | binaryen-7dc6147ffad3cd13b711a7192b8fb9d234bc914b.tar.gz binaryen-7dc6147ffad3cd13b711a7192b8fb9d234bc914b.tar.bz2 binaryen-7dc6147ffad3cd13b711a7192b8fb9d234bc914b.zip |
Validate tag param types (#5759)
We already validated function params, but were missing tags.
Without this the fuzzer can get confused if a type is only used in a tag.
-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 b92727e0e..239c79e3f 100644 --- a/src/wasm/wasm-validator.cpp +++ b/src/wasm/wasm-validator.cpp @@ -3683,11 +3683,16 @@ static void validateTags(Module& module, ValidationInfo& info) { curr->name, "Multivalue tag type requires multivalue [--enable-multivalue]"); } + FeatureSet features; for (const auto& param : curr->sig.params) { + features |= param.getFeatures(); info.shouldBeTrue(param.isConcrete(), curr->name, "Values in a tag should have concrete types"); } + info.shouldBeTrue(features <= module.features, + curr->name, + "all param types in tags should be allowed"); } } |