From f4b0ea75aa56349c970b9ae7c156e2f6fd87de3d Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 20 Mar 2023 08:55:18 -0700 Subject: Ensure a deterministic order in the type names section (#5590) Before this PR we iterated over an unordered set. Replace that with an iteration on a vector. (Also, the value in the set was not even used, so this should even be faster.) Add random names in the fuzzer to types, the lack of which is I believe the reason this was not detected before. --- src/tools/fuzzing/fuzzing.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/tools/fuzzing/fuzzing.cpp') diff --git a/src/tools/fuzzing/fuzzing.cpp b/src/tools/fuzzing/fuzzing.cpp index 73aff5acb..45cfbde0f 100644 --- a/src/tools/fuzzing/fuzzing.cpp +++ b/src/tools/fuzzing/fuzzing.cpp @@ -263,6 +263,11 @@ void TranslateToFuzzReader::setupHeapTypes() { // non-nullable bottom heap type). if (!type.isBottom() && !type.isBasic()) { interestingHeapTypes.push_back(type); + if (oneIn(2)) { + // Add a name for this type. + wasm.typeNames[type].name = + "generated_type$" + std::to_string(interestingHeapTypes.size()); + } } } } -- cgit v1.2.3