Skip to content

Commit 7eab93b

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: JIT: Fixed incorrect reference handling in PRE_INC/DEC_OBJ
2 parents 919fd56 + 6ab36fb commit 7eab93b

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,12 +2184,14 @@ static void ZEND_FASTCALL zend_jit_dec_typed_prop(zval *var_ptr, zend_property_i
21842184

21852185
static void ZEND_FASTCALL zend_jit_pre_inc_typed_prop(zval *var_ptr, zend_property_info *prop_info, zval *result)
21862186
{
2187+
ZVAL_DEREF(var_ptr);
21872188
zend_jit_inc_typed_prop(var_ptr, prop_info);
21882189
ZVAL_COPY(result, var_ptr);
21892190
}
21902191

21912192
static void ZEND_FASTCALL zend_jit_pre_dec_typed_prop(zval *var_ptr, zend_property_info *prop_info, zval *result)
21922193
{
2194+
ZVAL_DEREF(var_ptr);
21932195
zend_jit_dec_typed_prop(var_ptr, prop_info);
21942196
ZVAL_COPY(result, var_ptr);
21952197
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
PRE_INC_OBJ: 003
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=1M
8+
opcache.protect_memory=1
9+
--FILE--
10+
<?php
11+
class Test {
12+
public float $prop = 1.0;
13+
}
14+
$test = new Test;
15+
$r = &$test->prop;
16+
$v = --$test->prop;
17+
var_dump($v);
18+
?>
19+
--EXPECT--
20+
float(0)

0 commit comments

Comments
 (0)