From ba38593f5bf3007a88577adacddf6ed3004e9d63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Tue, 29 Sep 2026 07:25:03 +0300 Subject: [PATCH] lane-av1refusalspan: a spinning scanner arm must fail the suite, not hang it 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.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/ec-av1/src/refusal_inventory.rs b/crates/ec-av1/src/refusal_inventory.rs index 66743ce6..86f56b01 100644 --- a/crates/ec-av1/src/refusal_inventory.rs +++ b/crates/ec-av1/src/refusal_inventory.rs @@ -2257,7 +2257,15 @@ mod tests { let mut i = gate_at; let mut depth = 0usize; let mut open = None; + let mut last: Option = None; while i < b.len() { + // Every arm advances `i`, including the ones that `continue`. A spin + // here would hang the suite instead of failing it, which is the one + // outcome a boundary finder must never have. + if let Some(last) = last { + debug_assert!(i > last, "body_braces: an arm must advance the cursor"); + } + last = Some(i); match b[i] { b'/' if b.get(i + 1) == Some(&b'/') => { i = src[i..].find('\n').map_or(b.len(), |n| i + n + 1);