Repository navigation
Language: AOT Closure::bindTo bound $this + scope (#27219) - #27221
Merged
Merged
Conversation
Free-closure bindTo lost Variable::closureCall across assigns, so bind()
returned null and thin AOT aborted on invoke. Recover the inner via the
same single-candidate / lastClosureCallProxy fallback as Closure::call,
stash ClosureWithBinding for FUNCCALL_EXEC_RETURN, and write the Native
{closure}_N TARGET on the cloned object for RuntimeIndirect dispatch.
Co-authored-by: Cursor <cursoragent@cursor.com>
propertyFetch of IS_STATIC/IS_METHOD on free closures reads uninitialized slots and segfaults thin AOT; set those flags from Variable metadata only. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 3, 2026
Closed
PurHur
added a commit
that referenced
this pull request
Aug 3, 2026
…27224) (#27230) * Trust: refresh gen-0 argv fingerprint after #27221 (Pillar 1) (#27224) Honest make bootstrap-gen0-refresh-argv-driver after Closure::bindTo lowering drift; stamp verified-fresh fingerprint b60f971b… and sync inventory construct flags so north-star5-fast step 4f-m clears. Co-authored-by: Cursor <cursoragent@cursor.com> * Trust: restamp gen-0 argv after #27225 rebase (#27224) Re-run honest argv refresh so fingerprint matches tip live sources (9bbac6a0…) after call_user_func TypeError landed on master. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: PurHur <PurHur@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com>
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
bindTolostVariable::closureCall, sobind()returned null and thin AOT aborted on invoke — recover the inner via the same single-candidate /lastClosureCallProxyfallback asClosure::call(Regression: AOT Closure::call prints empty — VM/JIT match Zend (Zend/zend_closures.c) #26872), stashClosureWithBindingforFUNCCALL_EXEC_RETURN, and write the Native{closure}_NTARGET on the clone.propertyFetch/copyuninitializedIS_STATIC/IS_METHODslots on free closures (segfault under thin AOT); set those flags from Variable metadata only.Closes #27219
php-src reference
Zend/zend_closures.c—ZEND_METHOD(Closure, bindTo)/zend_closure_bind_toPHP implementation
lib/JIT/ClosureBindHelper.php— fallback + clone TARGET/flagslib/JIT/ClosureHelper.php—storeInvokeTargettrampolinelib/JIT.php—attachBoundClosureInvokeMetadataTest plan
7(private$x) matching Zend/VM/JIT--repeatstyle: 10/10 matchedvendor/bin/phpunit --filter ClosureBindToAotProxyTest— OK (2 tests)test/repro/maintainer_gap_aot_closure_bindto.phpVerification transcript
Made with Cursor