AOT: static property assign from closure must use module globals (#31965) - #31986
Merged
Conversation
) Typed static property writes inside closures were promoted to stack allocas, dropping staticPropertyGlobal metadata so stores never marked the init flag. Route native-scalar static lvalues through staticPropertyStore, skip the typed-static read guard on BP_VAR_W fetches, and add AOT regression fixtures. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 18, 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.
Closes #31965
Problem
AOT typed static property writes inside closures were promoted to stack
allocaslots, droppingstaticPropertyGlobal/staticPropertyInitGlobalmetadata. Stores updated the stack slot but never marked the module init flag, so reads after the closure failed withTyped static property … must not be accessed before initialization.The probe-reported unstable garbage integer on untyped static properties could not be reproduced on current master (post-#31894); the untyped closure write/read repro is stable
12across repeated runs. This PR adds regression guards for that path and fixes the typed-static failure found while hunting.Fix (PHP-in-PHP, no new
runtime/C)ObjectStaticPropertyLlvm::fetch($forWrite)— skip typed-static uninit read guard on BP_VAR_W fetches (matches VM!$mutatesinTYPE_STATIC_PROPERTY_FETCH)JIT::assignOperand— before native scalar KIND_VALUE promotion / same-type direct store, route class static lvalues throughstaticPropertyStoreso init flags are markedVerification
Did not run full
ci-local.sh, compliance shards, ornorth-star5-verify --strict.Made with Cursor