Make the subtract lazy in the icache fuzz target (#4732)
This unchecked, always-performed subtract *could* be the cause of #4731, if the immediate was 0 in the first place.
This commit is contained in:
@@ -96,7 +96,7 @@ fuzz_target!(|func: SingleFunction| {
|
|||||||
let imm = imm.bits();
|
let imm = imm.bits();
|
||||||
cursor.func.dfg[inst] = ir::InstructionData::UnaryImm {
|
cursor.func.dfg[inst] = ir::InstructionData::UnaryImm {
|
||||||
opcode: ir::Opcode::Iconst,
|
opcode: ir::Opcode::Iconst,
|
||||||
imm: Imm64::new(imm.checked_add(1).unwrap_or(imm - 1)),
|
imm: Imm64::new(imm.checked_add(1).unwrap_or_else(|| imm - 1)),
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
cursor.func.dfg[inst] = ir::InstructionData::UnaryImm {
|
cursor.func.dfg[inst] = ir::InstructionData::UnaryImm {
|
||||||
|
|||||||
Reference in New Issue
Block a user