mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
The jammed loop tests its exit only when `(j & 3) === 3`. When the inner counter starts at NaN, an infinity, or a value that `j + 1` leaves unchanged, `j & 3` never becomes 3, and the loop ran past the point where every accumulator was full, without end when its bound never ends it. The every-fourth test is now used only when the inner loop starts at an int32 literal: the counter then takes consecutive integer values, so its low bits reach 3 within four iterations. From any other start, the jammed loop tests its exit every iteration. The unit test checks which starts get each test, and the corpus program adds loops starting at -Infinity and -(2 ** 54) that end once both pixels escape.