You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7dfe139
Browse filesBrowse the repository at this point in the historyBrowse files
Do not infer by-ref use effects at invocations for a closure assigned to its own by-ref variable
- ClosureSignatureInference::getByRefUseMarkers() returns no markers for a
closure that is the right side of an assignment to one of its by-ref uses
(`$f = function () use (&$f)`). The body can reach the closure itself
through that variable in ways the invocation tracking does not follow, so
those by-ref uses keep the creation-time fixpoint. Before this, a body that
only reached itself indirectly (a nested closure or arrow function capturing
`$f`, an alias, `call_user_func($f)`, `$f->__invoke()`, or just reading `$f`)
was entered with `$f` as it was before the assignment: `null`.
- getAssignedClosures() takes a `$nested` flag (cached under its own
attribute) to also look inside nested function-likes. A closure created in
another closure's body is observed through the enclosing function's frame.
- The turbo-ext C++ mirror (ClosureSignatureInference.cpp and its generated
header) is updated the same way.
- Considered first: making the existing "body invokes its own by-ref
variable" guard follow captures into nested closures and arrow functions.
That fixes the reported nested case but misses aliasing, call_user_func,
__invoke and plain reads. It also makes mutual recursion through a captured
variable less precise, so I didn't use it.
0 commit comments