summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-02-16 17:43:24 +0000
committerGitHub <noreply@github.com>2021-02-16 09:43:24 -0800
commit3a368f480bcdc36564650f3c0236818613e5d510 (patch)
tree7d3d252abd20d0c5eba5e696357966c3d19af0f7 /src
parent097b70ce2f53e9cc110c1b5f9cac359a0129994f (diff)
downloadbinaryen-3a368f480bcdc36564650f3c0236818613e5d510.tar.gz
binaryen-3a368f480bcdc36564650f3c0236818613e5d510.tar.bz2
binaryen-3a368f480bcdc36564650f3c0236818613e5d510.zip
[GC] Fuzzer: Avoid creating tuples with non-defaultable types (#3567)
Diffstat (limited to 'src')
-rw-r--r--src/tools/fuzzing.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h
index f13b99c3d..1cc3635dc 100644
--- a/src/tools/fuzzing.h
+++ b/src/tools/fuzzing.h
@@ -1576,6 +1576,10 @@ private:
}
Expression* makeTupleExtract(Type type) {
+ // Tuples can require locals in binary format conversions.
+ if (!type.isDefaultable()) {
+ return makeTrivial(type);
+ }
assert(wasm.features.hasMultivalue());
assert(type.isSingle() && type.isConcrete());
Type tupleType = getTupleType();
@@ -3099,9 +3103,9 @@ private:
size_t maxElements = 2 + upTo(MAX_TUPLE_SIZE - 1);
for (size_t i = 0; i < maxElements; ++i) {
auto type = getSingleConcreteType();
- // Don't add a non-nullable type into a tuple, as currently we can't spill
- // them into locals (that would require a "let").
- if (!type.isNullable()) {
+ // Don't add a non-defaultable type into a tuple, as currently we can't
+ // spill them into locals (that would require a "let").
+ if (type.isDefaultable()) {
elements.push_back(type);
}
}