Skip to content

Commit

Permalink
Fix cranelift-fuzzgen fuzzer from TrapCode refactoring
Browse files Browse the repository at this point in the history
This commit fixes an issue found on OSS-Fuzz for the cranelift-fuzzgen
fuzzer which was caused by bytecodealliance#9338 but that PR forgot to fix.
  • Loading branch information
alexcrichton committed Oct 3, 2024
1 parent 80ed395 commit 1728c3d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fuzz/fuzz_targets/cranelift-fuzzgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ impl Default for Statistics {
// Pre-Register all trap codes since we can't modify this hashmap atomically.
let mut run_result_trap = HashMap::new();
run_result_trap.insert(CraneliftTrap::Debug, AtomicU64::new(0));
run_result_trap.insert(CraneliftTrap::BadSignature, AtomicU64::new(0));
run_result_trap.insert(CraneliftTrap::UnreachableCodeReached, AtomicU64::new(0));
run_result_trap.insert(CraneliftTrap::HeapMisaligned, AtomicU64::new(0));
for trapcode in TrapCode::non_user_traps() {
run_result_trap.insert(CraneliftTrap::User(*trapcode), AtomicU64::new(0));
}
Expand Down

0 comments on commit 1728c3d

Please sign in to comment.