Commit f7d65d50 authored by Manos Koukoutos's avatar Manos Koukoutos Committed by V8 LUCI CQ

[fuzzer] Generate gc types only in liftoff mode

Bug: v8:11954
Change-Id: I4886109edf5a732736051205076bed78fe78d5e2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3141582
Commit-Queue: Manos Koukoutos <manoskouk@chromium.org>
Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76676}
parent 787bec09
......@@ -108,6 +108,7 @@ ValueType GetValueType(uint32_t num_types, DataRange* data,
kWasmS128, kWasmExternRef,
kWasmFuncRef, kWasmEqRef,
kWasmAnyRef, ValueType::Ref(HeapType(HeapType::kData), kNullable)};
constexpr int kLiftoffOnlyTypeCount = 3; // at the end of {types}.
if (liftoff_as_reference) {
uint32_t id = data->get<uint8_t>() % (arraysize(types) + num_types);
......@@ -116,7 +117,8 @@ ValueType GetValueType(uint32_t num_types, DataRange* data,
}
return types[id];
}
return types[data->get<uint8_t>() % arraysize(types)];
return types[data->get<uint8_t>() %
(arraysize(types) - kLiftoffOnlyTypeCount)];
}
class WasmGenerator {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment