summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tools/fuzzing.h10
-rw-r--r--test/passes/translate-to-fuzz_all-features_metrics_noprint.txt57
2 files changed, 36 insertions, 31 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);
}
}
diff --git a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
index 36ed6b87e..97d0310e1 100644
--- a/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
+++ b/test/passes/translate-to-fuzz_all-features_metrics_noprint.txt
@@ -1,38 +1,39 @@
total
[events] : 2
- [exports] : 11
- [funcs] : 11
+ [exports] : 12
+ [funcs] : 14
[globals] : 6
[imports] : 5
[memory-data] : 22
- [table-data] : 1
+ [table-data] : 2
[tables] : 1
- [total] : 850
- [vars] : 29
- AtomicFence : 1
- Binary : 95
- Block : 122
- Break : 19
- Call : 44
- CallRef : 5
- Const : 126
- Drop : 10
- GlobalGet : 62
- GlobalSet : 30
- If : 35
- Load : 24
- LocalGet : 69
- LocalSet : 39
- Loop : 23
+ [total] : 555
+ [vars] : 42
+ AtomicFence : 2
+ AtomicNotify : 1
+ Binary : 72
+ Block : 60
+ Break : 16
+ Call : 34
+ CallRef : 1
+ Const : 109
+ DataDrop : 1
+ Drop : 5
+ GlobalGet : 28
+ GlobalSet : 14
+ If : 25
+ Load : 20
+ LocalGet : 53
+ LocalSet : 26
+ Loop : 3
MemoryFill : 1
- Nop : 14
- RefFunc : 5
- RefIs : 2
- RefNull : 28
- Return : 33
- SIMDExtract : 4
- Select : 5
+ Nop : 2
+ RefEq : 1
+ RefFunc : 2
+ RefNull : 26
+ Return : 16
+ Select : 2
Store : 3
TupleExtract : 4
TupleMake : 6
- Unary : 41
+ Unary : 22