From b4eedf3f3213beb7631c47ccda582cb7f510a292 Mon Sep 17 00:00:00 2001 From: Chris Fallin Date: Fri, 21 Oct 2022 09:08:27 -0700 Subject: [PATCH] Fix the `moves` fuzz target. (#97) * Fix iteration bug in move fuzz-target driver. * Remove panic no longer needed: stack-to-stack moves are now properly handled. --- fuzz/fuzz_targets/moves.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fuzz/fuzz_targets/moves.rs b/fuzz/fuzz_targets/moves.rs index 0becec3..ce9ea4d 100644 --- a/fuzz/fuzz_targets/moves.rs +++ b/fuzz/fuzz_targets/moves.rs @@ -62,7 +62,7 @@ impl Arbitrary<'_> for TestCase { // We might have some unallocated registers free for scratch // space... - for i in u.int_in_range(0..=2) { + for i in 0..u.int_in_range(0..=2)? { let reg = PReg::new(30 + i, RegClass::Int); ret.available_pregs.push(Allocation::reg(reg)); } @@ -107,10 +107,6 @@ fuzz_target!(|testcase: TestCase| { // Simulate the sequence of moves. let mut locations: HashMap = HashMap::new(); for (src, dst, _) in moves { - if is_stack_alloc(src) && is_stack_alloc(dst) { - panic!("Stack-to-stack move!"); - } - let data = locations.get(&src).cloned().unwrap_or(src); locations.insert(dst, data); }