mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-06 08:23:19 +08:00
The bounds guard of a versioned typed-array loop runs before the loop's initializer, and the stability scan covered the body, condition and update only. An initializer that rebinds the indexed array (`for (let i = (a = b, 0); i < n; i++) a[i]`) kept the bounds the guard proved for the old array: the unchecked loop then read and wrote past a shorter replacement. The scan now includes the initializer, so a binding it writes is not invariant and the loop runs checked. Loops whose initializer leaves the receiver alone version as before.