Skip to content

Fix GH-24634: Tracing JIT reads a stale stack slot at a side exit - #24635

Open
lazerg wants to merge 1 commit into
php:PHP-8.4from
lazerg:fix/gh-24634-jit-last-use
Open

lazerg wants to merge 1 commit into
php:PHP-8.4from
lazerg:fix/gh-24634-jit-last-use

Conversation

@lazerg

@lazerg lazerg commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

zend_ssa_is_last_use() only looked at the next use in the chain. If that use was a no-val use (an assignment that overwrites the CV) on one branch, it treated the current use as the last one, even when another branch still reads the value. The tracing JIT then dropped the CV's register without storing it, and a side exit into the other branch read a stale stack slot. Now it keeps going past no-val uses and only reports a last use when no real read follows.

Fixes GH-24634

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant