Fix AOT superglobal isset and coalesce lowering (partial #99, #148)#448
Closed
PurHur wants to merge 1 commit into
Closed
Fix AOT superglobal isset and coalesce lowering (partial #99, #148)#448PurHur wants to merge 1 commit into
PurHur wants to merge 1 commit into
Conversation
- Lower ?? into the assignee slot when php-cfg emits Assign immediately after Coalesce - Reuse isset container/dim slots for the left-branch fetch (wrong $_GET slot) - Resolve isset targets before branching so child blocks inherit scope - Use runtime __hashtable__offsetIsSetStringKey for superglobal isset in JIT - Branch coalesce merge from branch tail blocks, not entry blocks AOT aot-link: 117 tests, 1 remaining failure (coalesce_get_present empty output). VM coalesce with $_GET works; LLVM echo after merge still needs follow-up. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isset()in LLVM/AOT to use runtime__hashtable__offsetIsSetStringKeyinstead of baking compile-time false whenQUERY_STRINGis only known at run time.??lowering when php-cfg emitsAssignafterCoalesce: write into the assignee slot, reuse the same$_GETslot for isset and fetch, and inherit scope after isset operands are compiled.Test output (Docker
php-compiler:22.04-dev, tar copy harness)Before (master): 2 failures (
coalesce_get_present,superglobal_get_assignmunmap).After: 1 failure remaining.
Remaining failure (needs follow-up)
Repro:
VM path works with the same sources (
bin/vm.phpprintsAda). Issue is LLVM merge/echo of the coalesce result, not the compiler CFG.Test plan
vendor/bin/phpunit --group aot-link --exclude-group servein Docker (116/117 pass)coalesce_get_presentAOT outputAda/Guest(tracked above)./script/ci-local.shin Docker when mergingMade with Cursor