Skip to content

Commit b4eedf3

Browse files
authored
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.
1 parent d6b1509 commit b4eedf3

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

fuzz/fuzz_targets/moves.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl Arbitrary<'_> for TestCase {
6262

6363
// We might have some unallocated registers free for scratch
6464
// space...
65-
for i in u.int_in_range(0..=2) {
65+
for i in 0..u.int_in_range(0..=2)? {
6666
let reg = PReg::new(30 + i, RegClass::Int);
6767
ret.available_pregs.push(Allocation::reg(reg));
6868
}
@@ -107,10 +107,6 @@ fuzz_target!(|testcase: TestCase| {
107107
// Simulate the sequence of moves.
108108
let mut locations: HashMap<Allocation, Allocation> = HashMap::new();
109109
for (src, dst, _) in moves {
110-
if is_stack_alloc(src) && is_stack_alloc(dst) {
111-
panic!("Stack-to-stack move!");
112-
}
113-
114110
let data = locations.get(&src).cloned().unwrap_or(src);
115111
locations.insert(dst, data);
116112
}

0 commit comments

Comments
 (0)