diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2020-04-03 23:32:48 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-03 23:32:48 -0700 |
commit | ac8b0b71219a1c96d3dab4c9eeddbb4c8401cd1d (patch) | |
tree | a2b545214afc6cea7109bce6ff2dab53a827a7a9 /src | |
parent | 80c5164e1f50ed26e6fab373a563fd7a84135429 (diff) | |
download | binaryen-ac8b0b71219a1c96d3dab4c9eeddbb4c8401cd1d.tar.gz binaryen-ac8b0b71219a1c96d3dab4c9eeddbb4c8401cd1d.tar.bz2 binaryen-ac8b0b71219a1c96d3dab4c9eeddbb4c8401cd1d.zip |
Do not emit multivalue events in fuzzer (#2723)
Unless the multivalue feature is enabled. The validation for events
recently changed to disallow events returning multiple items unless
the multivalue feature is enabled, but the fuzzer was not updated
accordingly. This PR fixes the glitch.
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/fuzzing.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h index 96dd43826..f08fac2d9 100644 --- a/src/tools/fuzzing.h +++ b/src/tools/fuzzing.h @@ -428,8 +428,9 @@ private: Type type = getConcreteType(); std::vector<Type> params; params.push_back(type); - Index numValues = upToSquared(MAX_PARAMS - 1); - for (Index i = 0; i < numValues + 1; i++) { + Index numValues = + wasm.features.hasMultivalue() ? upToSquared(MAX_PARAMS) : upTo(2); + for (Index i = 0; i < numValues; i++) { params.push_back(getConcreteType()); } auto* event = builder.makeEvent(std::string("event$") + std::to_string(i), |