Fix AOT spurious undef warnings on assigned {main} script CV reads (#31835 / #36081) - #36095
Merged
PurHur merged 1 commit intoAug 31, 2026
Conversation
…31835 / #36081). ScopeVariableAssignedFlags keyed {main} locals off activeFunction, which can drift while later class bodies lower in the same translation unit — markAssigned stored under one key while TYPE_ASSIGN RHS guards checked another (e.g. $a->x = $a after $a = new A when a promoted-ctor class appears later in the file). Use a stable '{main}' flag key whenever jitEnclosingBlock is the file-scope body. Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur
deleted the
agent/issue-31835-aot-script-global-assign-rhs-undef-guard
branch
August 31, 2026 16:35
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
ScopeVariableAssignedFlags::flagKey()keyed{main}script CVs offContext::$activeFunction, which can drift while later class bodies (e.g. a promoted-ctorPromo) lower in the same translation unit.$a = new Astored the assigned flag under one key;$a->x = $aTYPE_ASSIGN RHS guards checked another → spuriousUndefined variable $awarnings even though output was correct.'{main}\0$name'flag key wheneverjitEnclosingBlock(orjitFunctionRootBlock) is the file-scope{main}body.Regression surfaced by
TypedPropSelfParent31835AotTest::testComplianceCaseMatchesZendafter #36081 script-global undef guards landed.Closes #31835 (AOT follow-up)
Verification
Not run: full differential sweep (prior master capture green at 125/125).
Made with Cursor