mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: JIT: Fixed incorrect reference handling in PRE_INC/DEC_OBJ
This commit is contained in:
@@ -2184,12 +2184,14 @@ static void ZEND_FASTCALL zend_jit_dec_typed_prop(zval *var_ptr, zend_property_i
|
||||
|
||||
static void ZEND_FASTCALL zend_jit_pre_inc_typed_prop(zval *var_ptr, zend_property_info *prop_info, zval *result)
|
||||
{
|
||||
ZVAL_DEREF(var_ptr);
|
||||
zend_jit_inc_typed_prop(var_ptr, prop_info);
|
||||
ZVAL_COPY(result, var_ptr);
|
||||
}
|
||||
|
||||
static void ZEND_FASTCALL zend_jit_pre_dec_typed_prop(zval *var_ptr, zend_property_info *prop_info, zval *result)
|
||||
{
|
||||
ZVAL_DEREF(var_ptr);
|
||||
zend_jit_dec_typed_prop(var_ptr, prop_info);
|
||||
ZVAL_COPY(result, var_ptr);
|
||||
}
|
||||
|
||||
20
ext/opcache/tests/jit/inc_obj_003.phpt
Normal file
20
ext/opcache/tests/jit/inc_obj_003.phpt
Normal file
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
PRE_INC_OBJ: 003
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
opcache.file_update_protection=0
|
||||
opcache.jit_buffer_size=1M
|
||||
opcache.protect_memory=1
|
||||
--FILE--
|
||||
<?php
|
||||
class Test {
|
||||
public float $prop = 1.0;
|
||||
}
|
||||
$test = new Test;
|
||||
$r = &$test->prop;
|
||||
$v = --$test->prop;
|
||||
var_dump($v);
|
||||
?>
|
||||
--EXPECT--
|
||||
float(0)
|
||||
Reference in New Issue
Block a user