Skip to content

Commit ff8095d

Browse files
authored
[threads] Fuzz shared types in type fuzzer (#6704)
Give the type fuzzer the ability to generate shared heap types when the shared-everything feature is enabled. It correctly ensures that shared structs and arrays cannot reference unshared heap types, but that unshared heap types can reference any heap type. Update the main fuzzer so that for the time being it never uses the shared-everything feature when generating additional heap types, so it never generates shared types. We can lift this restriction once the main fuzzer has been updated to properly handle shared types. As a drive-by, fix some logic for subtracting feature sets from each other that is used in this commit.
1 parent d6b4f01 commit ff8095d

File tree

5 files changed

+182
-144
lines changed

5 files changed

+182
-144
lines changed

src/tools/fuzzing/fuzzing.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,11 @@ void TranslateToFuzzReader::setupHeapTypes() {
246246

247247
// For GC, also generate random types.
248248
if (wasm.features.hasGC()) {
249+
// Do not generate shared types until the fuzzer can be updated to handle
250+
// them.
251+
auto features = wasm.features - FeatureSet::SharedEverything;
249252
auto generator =
250-
HeapTypeGenerator::create(random, wasm.features, upTo(MAX_NEW_GC_TYPES));
253+
HeapTypeGenerator::create(random, features, upTo(MAX_NEW_GC_TYPES));
251254
auto result = generator.builder.build();
252255
if (auto* err = result.getError()) {
253256
Fatal() << "Failed to build heap types: " << err->reason << " at index "

0 commit comments

Comments
 (0)