diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/fuzzing.h | 4 | ||||
-rw-r--r-- | src/wasm/wasm-type.cpp | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h index 91a808d32..fb83882c2 100644 --- a/src/tools/fuzzing.h +++ b/src/tools/fuzzing.h @@ -327,8 +327,10 @@ private: options.push_back(type); // includes itself switch (type.getSingle()) { case Type::anyref: + if (wasm.features.hasExceptionHandling()) { + options.push_back(Type::exnref); + } options.push_back(Type::funcref); - options.push_back(Type::exnref); // falls through case Type::funcref: case Type::exnref: diff --git a/src/wasm/wasm-type.cpp b/src/wasm/wasm-type.cpp index d1cdf6a81..7d51cc10e 100644 --- a/src/wasm/wasm-type.cpp +++ b/src/wasm/wasm-type.cpp @@ -199,14 +199,16 @@ Type Type::reinterpret() const { } FeatureSet Type::getFeatures() const { - auto getSingleFeatures = [](Type t) { + auto getSingleFeatures = [](Type t) -> FeatureSet { switch (t.getSingle()) { case Type::v128: return FeatureSet::SIMD; + case Type::funcref: case Type::anyref: + case Type::nullref: return FeatureSet::ReferenceTypes; case Type::exnref: - return FeatureSet::ExceptionHandling; + return FeatureSet::ReferenceTypes | FeatureSet::ExceptionHandling; default: return FeatureSet::MVP; } |