forge
Explore
Log in

Don't you dare go Hollow

lane-av1refusalspan: a spinning scanner arm must fail the suite, not hang it

Browse files at this commit

ba38593f5bf3007a88577adacddf6ed3004e9d63Ahmet Kaan GümüşParent: cc885c2
Found by mutation M3: replacing the string-literal skip with a plain
`continue` turns the boundary finder into an infinite loop, and the
boundary test hung for 600s instead of failing. Every arm now has to
advance the cursor, asserted at the top of the loop, so a future arm that
forgets to moves the failure from a hung suite to a failed one.
crates/ec-av1/src/refusal_inventory.rsmodified+8 -0
@@ -2257,7 +2257,15 @@ mod tests {
22572257 let mut i = gate_at;
22582258 let mut depth = 0usize;
22592259 let mut open = None;
2260+ let mut last: Option<usize> = None;
22602261 while i < b.len() {
2262+ // Every arm advances `i`, including the ones that `continue`. A spin
2263+ // here would hang the suite instead of failing it, which is the one
2264+ // outcome a boundary finder must never have.
2265+ if let Some(last) = last {
2266+ debug_assert!(i > last, "body_braces: an arm must advance the cursor");
2267+ }
2268+ last = Some(i);
22612269 match b[i] {
22622270 b'/' if b.get(i + 1) == Some(&b'/') => {
22632271 i = src[i..].find('\n').map_or(b.len(), |n| i + n + 1);