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
JIT+private array property access inside closure accesses private property in child class #12380
changed the title [-]JIT+Isset on a private property inside fiber accesses private property in child class[/-][+]JIT+Isset on a private property inside closure accesses private property in child class[/+]on Oct 7, 2023
changed the title [-]JIT+Isset on a private property inside closure accesses private property in child class[/-][+]JIT+private array property access inside closure accesses private property in child class[/+]on Oct 7, 2023
Thanks for the nice reproducer, I can reproduce this with the tracing jit only (not function jit etc). var_dump($this->v) inside the closure shows that we're getting the array from a, but var_dump($this); shows both as expected.
EDIT: I think the problem is that zend_get_known_property_info doesn't take into account that the scope matters for private properties, I'll try something and report back.
Activity
[-]JIT+Isset on a private property inside fiber accesses private property in child class[/-][+]JIT+Isset on a private property inside closure accesses private property in child class[/+][-]JIT+Isset on a private property inside closure accesses private property in child class[/-][+]JIT+private array property access inside closure accesses private property in child class[/+]ndossche commentedon Oct 7, 2023
Thanks for the nice reproducer, I can reproduce this with the tracing jit only (not function jit etc).
var_dump($this->v)inside the closure shows that we're getting the array froma, butvar_dump($this);shows both as expected.EDIT: I think the problem is that zend_get_known_property_info doesn't take into account that the scope matters for private properties, I'll try something and report back.
iluuu1994 commentedon Oct 7, 2023
@danog Fantastic, thank you for the reproducer! 🙂
Fix phpGH-12380: JIT+private array property access inside closure acc…
Fix phpGH-12380: JIT+private array property access inside closure acc…
Merge branch 'PHP-8.1' into PHP-8.2
Merge branch 'PHP-8.2' into PHP-8.3
Merge branch 'PHP-8.3'
Fix phpGH-12380: JIT+private array property access inside closure acc…