summaryrefslogtreecommitdiff
path: root/src/tools/fuzzing.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/fuzzing.h')
-rw-r--r--src/tools/fuzzing.h40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h
index 63f10cac4..621555ab1 100644
--- a/src/tools/fuzzing.h
+++ b/src/tools/fuzzing.h
@@ -327,28 +327,31 @@ private:
}
SmallVector<Type, 2> options;
options.push_back(type); // includes itself
- TODO_SINGLE_COMPOUND(type);
- switch (type.getBasic()) {
- case Type::anyref:
- if (wasm.features.hasReferenceTypes()) {
- options.push_back(Type::funcref);
- options.push_back(Type::externref);
- if (wasm.features.hasExceptionHandling()) {
- options.push_back(Type::exnref);
+ // TODO: interesting uses of typed function types
+ // TODO: interesting subtypes of compound types
+ if (type.isBasic()) {
+ switch (type.getBasic()) {
+ case Type::anyref:
+ if (wasm.features.hasReferenceTypes()) {
+ options.push_back(Type::funcref);
+ options.push_back(Type::externref);
+ if (wasm.features.hasExceptionHandling()) {
+ options.push_back(Type::exnref);
+ }
+ if (wasm.features.hasGC()) {
+ options.push_back(Type::eqref);
+ options.push_back(Type::i31ref);
+ }
}
+ break;
+ case Type::eqref:
if (wasm.features.hasGC()) {
- options.push_back(Type::eqref);
options.push_back(Type::i31ref);
}
- }
- break;
- case Type::eqref:
- if (wasm.features.hasGC()) {
- options.push_back(Type::i31ref);
- }
- break;
- default:
- break;
+ break;
+ default:
+ break;
+ }
}
return pick(options);
}
@@ -1120,6 +1123,7 @@ private:
options.add(FeatureSet::ReferenceTypes | FeatureSet::GC,
&Self::makeI31New);
}
+ // TODO: struct.get and other GC things
return (this->*pick(options))(type);
}