You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
miscompile: an uncalled function containing new Proxy(arr, {}) makes an unrelated function's indexed read loop run zero iterations #7775
The mere PRESENCE of new Proxy(rawArray, {}) in a function that is never called makes an unrelated function's for (let i = 0; i < a.length; i++) read loop run zero iterations. Wrong answer, no diagnostic.
Delete neverCalled (or just its new Proxy line's function) → Perry prints 100. Bisected from a 10-case battery: of delete a[i], a[i] = undefined, a different-class store, class X extends Array, a.length = 5, and the proxy — only the proxy variant poisons the module (the others are all byte-identical to node in the same file).
The poisoning is static: neverCalled is never invoked. readLoop's loop body itself runs zero times (a leak = r side effect in a sibling case never fires), so the loop condition — not the sum — is what breaks.
The proxy loop ITSELF is correct when it is the only such function in the module (prints 100, byte-identical to node).
perry-dev profile, PERRY_NO_AUTO_OPTIMIZE=1, runtime pinned via PERRY_RUNTIME_DIR.
Found while building the #7771 criterion-3 hazard battery — the proxy hazard case had to be moved to its own compilation unit to keep the other nine cases meaningful.
Activity
docs(changelog): add fragment for the #7775 proxy name-collision fix
fix(hir): a local named like a proxy local is not a proxy (#7828)
fix(hir): key proxy detection on the resolved binding, not the spelli…
fix(hir): scope a bare-assignment native-instance tag to the binding (#…