Description
Description
Originally posted in #15819 (comment)
The following code:
<?php
class A {
private $_prop;
public $prop {
get => $this->_prop;
}
}
for ($i=0;$i<2;$i++)
echo (new A)->prop;
using opcache.jit=1101
Resulted in this output:
Segfault
But I expected this output instead:
No segfault
I analysed this and this is a different bug related to a cache slot optimization.
As far as I understand, this happens for when the cache slot satisfies the ZEND_IS_PROPERTY_HOOK_SIMPLE_GET
condition. Then we set up a function call frame and re-enter the VM to execute the hook function:
Lines 2094 to 2126 in 7c2204c
This seems incompatible with how the minimal JIT works, getting the property will be skipped.
Indeed if we get rid of ZEND_SET_PROPERTY_HOOK_SIMPLE_GET
in zend_object_handlers.c
or go to a higher optimization level the problem disappears. I'm not sure yet how to solve that.
PHP Version
master
Operating System
Linux