diff options
author | Thomas Lively <tlively@google.com> | 2024-06-26 11:19:04 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-26 11:19:04 -0700 |
commit | ff8095d8d3be56ba249014ab799cbddb3fd3ba10 (patch) | |
tree | 7640447ac35d9775784fce6223a9910921534585 /src/tools/fuzzing/fuzzing.cpp | |
parent | d6b4f0107a32066e7f3efbb4e9eb518ddcd914f5 (diff) | |
download | binaryen-ff8095d8d3be56ba249014ab799cbddb3fd3ba10.tar.gz binaryen-ff8095d8d3be56ba249014ab799cbddb3fd3ba10.tar.bz2 binaryen-ff8095d8d3be56ba249014ab799cbddb3fd3ba10.zip |
[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.
Diffstat (limited to 'src/tools/fuzzing/fuzzing.cpp')
-rw-r--r-- | src/tools/fuzzing/fuzzing.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tools/fuzzing/fuzzing.cpp b/src/tools/fuzzing/fuzzing.cpp index 6b54ac56d..555de5db1 100644 --- a/src/tools/fuzzing/fuzzing.cpp +++ b/src/tools/fuzzing/fuzzing.cpp @@ -246,8 +246,11 @@ void TranslateToFuzzReader::setupHeapTypes() { // For GC, also generate random types. if (wasm.features.hasGC()) { + // Do not generate shared types until the fuzzer can be updated to handle + // them. + auto features = wasm.features - FeatureSet::SharedEverything; auto generator = - HeapTypeGenerator::create(random, wasm.features, upTo(MAX_NEW_GC_TYPES)); + HeapTypeGenerator::create(random, features, upTo(MAX_NEW_GC_TYPES)); auto result = generator.builder.build(); if (auto* err = result.getError()) { Fatal() << "Failed to build heap types: " << err->reason << " at index " |