[wasm][fuzzer] Generate more and longer sequences
In Liftoff, bugs often happen only if specific cache states are constructed. For this, longer sequences of instructions are needed. Thus, add a few rules to increase the chance of generating longer sequences. R=ahaas@chromium.org Change-Id: I8f112edf0280282bf275585e8a15772013c25245 Reviewed-on: https://chromium-review.googlesource.com/1158695 Reviewed-by: Andreas Haas <ahaas@chromium.org> Commit-Queue: Clemens Hammacher <clemensh@chromium.org> Cr-Commit-Position: refs/heads/master@{#54927}
This commit is contained in:
parent
babc4422fd
commit
897e17a255
@ -382,9 +382,9 @@ class WasmGenerator {
|
||||
|
||||
void set_global(DataRange& data) { global_op<kWasmStmt>(data); }
|
||||
|
||||
template <ValueType T1, ValueType T2>
|
||||
template <ValueType... Types>
|
||||
void sequence(DataRange& data) {
|
||||
Generate<T1, T2>(data);
|
||||
Generate<Types...>(data);
|
||||
}
|
||||
|
||||
void current_memory(DataRange& data) {
|
||||
@ -474,6 +474,9 @@ void WasmGenerator::Generate<kWasmStmt>(DataRange& data) {
|
||||
|
||||
constexpr generate_fn alternates[] = {
|
||||
&WasmGenerator::sequence<kWasmStmt, kWasmStmt>,
|
||||
&WasmGenerator::sequence<kWasmStmt, kWasmStmt, kWasmStmt, kWasmStmt>,
|
||||
&WasmGenerator::sequence<kWasmStmt, kWasmStmt, kWasmStmt, kWasmStmt,
|
||||
kWasmStmt, kWasmStmt, kWasmStmt, kWasmStmt>,
|
||||
&WasmGenerator::block<kWasmStmt>,
|
||||
&WasmGenerator::loop<kWasmStmt>,
|
||||
&WasmGenerator::if_<kWasmStmt, kIf>,
|
||||
@ -510,7 +513,9 @@ void WasmGenerator::Generate<kWasmI32>(DataRange& data) {
|
||||
}
|
||||
|
||||
constexpr generate_fn alternates[] = {
|
||||
&WasmGenerator::sequence<kWasmI32, kWasmStmt>,
|
||||
&WasmGenerator::sequence<kWasmStmt, kWasmI32>,
|
||||
&WasmGenerator::sequence<kWasmStmt, kWasmI32, kWasmStmt>,
|
||||
|
||||
&WasmGenerator::op<kExprI32Eqz, kWasmI32>,
|
||||
&WasmGenerator::op<kExprI32Eq, kWasmI32, kWasmI32>,
|
||||
@ -599,7 +604,9 @@ void WasmGenerator::Generate<kWasmI64>(DataRange& data) {
|
||||
}
|
||||
|
||||
constexpr generate_fn alternates[] = {
|
||||
&WasmGenerator::sequence<kWasmI64, kWasmStmt>,
|
||||
&WasmGenerator::sequence<kWasmStmt, kWasmI64>,
|
||||
&WasmGenerator::sequence<kWasmStmt, kWasmI64, kWasmStmt>,
|
||||
|
||||
&WasmGenerator::op<kExprI64Add, kWasmI64, kWasmI64>,
|
||||
&WasmGenerator::op<kExprI64Sub, kWasmI64, kWasmI64>,
|
||||
@ -654,7 +661,9 @@ void WasmGenerator::Generate<kWasmF32>(DataRange& data) {
|
||||
}
|
||||
|
||||
constexpr generate_fn alternates[] = {
|
||||
&WasmGenerator::sequence<kWasmF32, kWasmStmt>,
|
||||
&WasmGenerator::sequence<kWasmStmt, kWasmF32>,
|
||||
&WasmGenerator::sequence<kWasmStmt, kWasmF32, kWasmStmt>,
|
||||
|
||||
&WasmGenerator::op<kExprF32Add, kWasmF32, kWasmF32>,
|
||||
&WasmGenerator::op<kExprF32Sub, kWasmF32, kWasmF32>,
|
||||
@ -685,7 +694,9 @@ void WasmGenerator::Generate<kWasmF64>(DataRange& data) {
|
||||
}
|
||||
|
||||
constexpr generate_fn alternates[] = {
|
||||
&WasmGenerator::sequence<kWasmF64, kWasmStmt>,
|
||||
&WasmGenerator::sequence<kWasmStmt, kWasmF64>,
|
||||
&WasmGenerator::sequence<kWasmStmt, kWasmF64, kWasmStmt>,
|
||||
|
||||
&WasmGenerator::op<kExprF64Add, kWasmF64, kWasmF64>,
|
||||
&WasmGenerator::op<kExprF64Sub, kWasmF64, kWasmF64>,
|
||||
|
Loading…
Reference in New Issue
Block a user