diff options
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/fuzzing/fuzzing.cpp | 6 | ||||
-rw-r--r-- | src/tools/fuzzing/heap-types.cpp | 6 | ||||
-rw-r--r-- | src/tools/wasm-fuzz-lattices.cpp | 13 |
3 files changed, 15 insertions, 10 deletions
diff --git a/src/tools/fuzzing/fuzzing.cpp b/src/tools/fuzzing/fuzzing.cpp index 57c7ec6b0..6b54ac56d 100644 --- a/src/tools/fuzzing/fuzzing.cpp +++ b/src/tools/fuzzing/fuzzing.cpp @@ -2556,7 +2556,8 @@ Expression* TranslateToFuzzReader::makeBasicRef(Type type) { auto heapType = type.getHeapType(); assert(heapType.isBasic()); assert(wasm.features.hasReferenceTypes()); - switch (heapType.getBasic()) { + assert(!heapType.isShared() && "TODO: handle shared types"); + switch (heapType.getBasic(Unshared)) { case HeapType::ext: { auto null = builder.makeRefNull(HeapType::ext); // TODO: support actual non-nullable externrefs via imported globals or @@ -4233,7 +4234,8 @@ HeapType TranslateToFuzzReader::getSubType(HeapType type) { return type; } if (type.isBasic() && oneIn(2)) { - switch (type.getBasic()) { + assert(!type.isShared() && "TODO: handle shared types"); + switch (type.getBasic(Unshared)) { case HeapType::func: // TODO: Typed function references. return pick(FeatureOptions<HeapType>() diff --git a/src/tools/fuzzing/heap-types.cpp b/src/tools/fuzzing/heap-types.cpp index 08b4c4453..127d4f5ba 100644 --- a/src/tools/fuzzing/heap-types.cpp +++ b/src/tools/fuzzing/heap-types.cpp @@ -377,7 +377,8 @@ struct HeapTypeGeneratorImpl { if (rand.oneIn(8)) { return type.getBottom(); } - switch (type.getBasic()) { + assert(!type.isShared() && "TODO: handle shared types"); + switch (type.getBasic(Unshared)) { case HeapType::func: return pickSubFunc(); case HeapType::cont: @@ -438,7 +439,8 @@ struct HeapTypeGeneratorImpl { // This is not a constructed type, so it must be a basic type. assert(type.isBasic()); candidates.push_back(type); - switch (type.getBasic()) { + assert(!type.isShared() && "TODO: handle shared types"); + switch (type.getBasic(Unshared)) { case HeapType::ext: case HeapType::func: case HeapType::exn: diff --git a/src/tools/wasm-fuzz-lattices.cpp b/src/tools/wasm-fuzz-lattices.cpp index d74bc5148..551ddbaf1 100644 --- a/src/tools/wasm-fuzz-lattices.cpp +++ b/src/tools/wasm-fuzz-lattices.cpp @@ -185,7 +185,7 @@ using LatticeVariant = std::variant<RandomFullLattice, ArrayLattice, Vector<RandomLattice>, TupleLattice, - Shared<RandomLattice>>; + SharedPath<RandomLattice>>; struct RandomLattice::LatticeImpl : LatticeVariant {}; @@ -196,7 +196,7 @@ using LatticeElementVariant = typename ArrayLattice::Element, typename Vector<RandomLattice>::Element, typename TupleLattice::Element, - typename Shared<RandomLattice>::Element>; + typename SharedPath<RandomLattice>::Element>; struct RandomLattice::ElementImpl : LatticeElementVariant {}; @@ -271,7 +271,7 @@ RandomLattice::RandomLattice(Random& rand, size_t depth) : rand(rand) { return; case FullLatticePicks + 5: lattice = std::make_unique<LatticeImpl>( - LatticeImpl{Shared{RandomLattice{rand, depth + 1}}}); + LatticeImpl{SharedPath{RandomLattice{rand, depth + 1}}}); return; } WASM_UNREACHABLE("unexpected pick"); @@ -375,7 +375,7 @@ RandomLattice::Element RandomLattice::makeElement() const noexcept { typename TupleLattice::Element{std::get<0>(l->lattices).makeElement(), std::get<1>(l->lattices).makeElement()}}; } - if (const auto* l = std::get_if<Shared<RandomLattice>>(lattice.get())) { + if (const auto* l = std::get_if<SharedPath<RandomLattice>>(lattice.get())) { auto elem = l->getBottom(); l->join(elem, l->lattice.makeElement()); return ElementImpl{elem}; @@ -489,8 +489,9 @@ void printElement(std::ostream& os, indent(os, depth); os << ")\n"; } else if (const auto* e = - std::get_if<typename Shared<RandomLattice>::Element>(&*elem)) { - os << "Shared(\n"; + std::get_if<typename SharedPath<RandomLattice>::Element>( + &*elem)) { + os << "SharedPath(\n"; printElement(os, **e, depth + 1); indent(os, depth); os << ")\n"; |