Skip to content

Fix GH-24678: Sync live variables before trace-ending calls - #25886

Open
aasul wants to merge 1 commit into
php:PHP-8.5from
aasul:investigate/gh24678-jit-side-trace
Open

aasul wants to merge 1 commit into
php:PHP-8.5from
aasul:investigate/gh24678-jit-side-trace

Conversation

@aasul

@aasul aasul commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

a side trace can end at DO_FCALL while a live variable is still held in a register. when execution returns to the interpreter, the variable's VM slot may still be undefined.

this fixes the issue by syncing live register values and required CV types before the call can switch execution frames. calls that continue into the callee are left unchanged.

also adds a PHPT regression test for GH-24678.

Testing

confirmed the regression test fails on unmodified PHP 8.5 and passes with the fix
JIT suite: 581 passed, 17 skipped, 0 failed
OPcache suite: 1,013 passed, 49 skipped, 1 expected failure, 0 failed
broader PHP suite: 12,442 passed; 5 failures reproduced on the unmodified baseline due to missing extensions
original reproducer passes with and without register allocation
120/120 additional edge-case configurations passed
100 repeated runs of the original failing configuration passed, plus 20 after rebuilding

PHP 8.4 is also affected, but needs a slightly different fix and the inherited-register handling from GH-24622.

release, ZTS and sanitizer builds haven't been completed.

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