diff options
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/fuzzing.h | 37 | ||||
-rw-r--r-- | src/tools/spec-wrapper.h | 5 | ||||
-rw-r--r-- | src/tools/wasm-reduce.cpp | 10 |
3 files changed, 50 insertions, 2 deletions
diff --git a/src/tools/fuzzing.h b/src/tools/fuzzing.h index e6cc4e444..0783588cd 100644 --- a/src/tools/fuzzing.h +++ b/src/tools/fuzzing.h @@ -324,6 +324,15 @@ private: if (wasm.features.hasExceptionHandling()) { options.push_back(Type::exnref); } + if (wasm.features.hasGC()) { + options.push_back(Type::eqref); + // TODO: i31ref + } + } + break; + case Type::eqref: + if (wasm.features.hasGC()) { + // TODO: i31ref } break; default: @@ -1362,6 +1371,8 @@ private: case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: case Type::none: case Type::unreachable: WASM_UNREACHABLE("invalid type"); @@ -1466,6 +1477,8 @@ private: case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: case Type::none: case Type::unreachable: WASM_UNREACHABLE("invalid type"); @@ -1595,6 +1608,8 @@ private: case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: case Type::none: case Type::unreachable: WASM_UNREACHABLE("invalid type"); @@ -1640,6 +1655,8 @@ private: case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: case Type::none: case Type::unreachable: WASM_UNREACHABLE("unexpected type"); @@ -1708,6 +1725,8 @@ private: case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: case Type::none: case Type::unreachable: WASM_UNREACHABLE("unexpected type"); @@ -1735,6 +1754,8 @@ private: case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: case Type::none: case Type::unreachable: WASM_UNREACHABLE("unexpected type"); @@ -1845,6 +1866,8 @@ private: case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: return makeTrivial(type); case Type::none: case Type::unreachable: @@ -1990,6 +2013,8 @@ private: case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: case Type::none: case Type::unreachable: WASM_UNREACHABLE("unexpected type"); @@ -2227,6 +2252,8 @@ private: case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: case Type::none: case Type::unreachable: WASM_UNREACHABLE("unexpected type"); @@ -2434,6 +2461,8 @@ private: case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: case Type::none: case Type::unreachable: WASM_UNREACHABLE("unexpected type"); @@ -2674,7 +2703,9 @@ private: .add(FeatureSet::ReferenceTypes, Type::funcref, Type::externref) .add(FeatureSet::ReferenceTypes | FeatureSet::ExceptionHandling, Type::exnref) - .add(FeatureSet::ReferenceTypes | FeatureSet::GC, Type::anyref)); + .add(FeatureSet::ReferenceTypes | FeatureSet::GC, + Type::anyref, + Type::eqref)); // TODO: i31ref } Type getSingleConcreteType() { return pick(getSingleConcreteTypes()); } @@ -2685,7 +2716,9 @@ private: .add(FeatureSet::ReferenceTypes, Type::funcref, Type::externref) .add(FeatureSet::ReferenceTypes | FeatureSet::ExceptionHandling, Type::exnref) - .add(FeatureSet::ReferenceTypes | FeatureSet::GC, Type::anyref)); + .add(FeatureSet::ReferenceTypes | FeatureSet::GC, + Type::anyref, + Type::eqref)); // TODO: i31ref } Type getReferenceType() { return pick(getReferenceTypes()); } diff --git a/src/tools/spec-wrapper.h b/src/tools/spec-wrapper.h index 200571fd0..5a61d72b6 100644 --- a/src/tools/spec-wrapper.h +++ b/src/tools/spec-wrapper.h @@ -61,6 +61,11 @@ static std::string generateSpecWrapper(Module& wasm) { case Type::anyref: ret += "(ref.null any)"; break; + case Type::eqref: + ret += "(ref.null eq)"; + break; + case Type::i31ref: + WASM_UNREACHABLE("TODO: i31ref"); case Type::none: case Type::unreachable: WASM_UNREACHABLE("unexpected type"); diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp index 7410ff91e..7a81007dc 100644 --- a/src/tools/wasm-reduce.cpp +++ b/src/tools/wasm-reduce.cpp @@ -599,6 +599,8 @@ struct Reducer case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: continue; // not implemented yet case Type::none: case Type::unreachable: @@ -625,6 +627,8 @@ struct Reducer case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: continue; // not implemented yet case Type::none: case Type::unreachable: @@ -651,6 +655,8 @@ struct Reducer case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: continue; // not implemented yet case Type::none: case Type::unreachable: @@ -677,6 +683,8 @@ struct Reducer case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: continue; // not implemented yet case Type::none: case Type::unreachable: @@ -689,6 +697,8 @@ struct Reducer case Type::externref: case Type::exnref: case Type::anyref: + case Type::eqref: + case Type::i31ref: continue; // not implemented yet case Type::none: case Type::unreachable: |