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
Function JIT: ++/-- on a typed property holding a reference throws TypeError #24154
Run with php -d opcache.enable_cli=1 -d opcache.file_update_protection=0 -d opcache.jit=function repro.php
Resulted in this output:
Fatal error: Uncaught TypeError: Cannot assign int to property Test::$value of type int in /path/to/repro.php:8
Stack trace:
#0 /path/to/repro.php(14): Test->inc()
#1 {main}
thrown in /path/to/repro.php on line 8
But I expected this output instead:
int(1)
$this->value-- fails the same way. It works as expected with opcache.jit=disable and opcache.jit=tracing.
This looks like a regression from 1b2bde4 (GH-24071). In zend_jit_inc_typed_prop() / zend_jit_dec_typed_prop(), ZVAL_DEREF(var_ptr); ZVAL_COPY(&tmp, var_ptr); was replaced with ZVAL_COPY_DEREF(&tmp, var_ptr);, which only dereferences the copy. var_ptr keeps pointing at the reference, so the property type check fails, and the error path then calls zval_ptr_dtor() on the reference and overwrites the property slot.
Function JIT calls these helpers directly when the result of the increment/decrement is unused.
Restoring the explicit dereference fixes maybe:
Activity
Fix GH-24154: Function JIT ++/-- on typed property holding a reference (