diff --git a/ext/opcache/jit/zend_jit_helpers.c b/ext/opcache/jit/zend_jit_helpers.c index a18409c441f..4a2ac7cf1e6 100644 --- a/ext/opcache/jit/zend_jit_helpers.c +++ b/ext/opcache/jit/zend_jit_helpers.c @@ -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); } diff --git a/ext/opcache/tests/jit/inc_obj_003.phpt b/ext/opcache/tests/jit/inc_obj_003.phpt new file mode 100644 index 00000000000..3e1eef52215 --- /dev/null +++ b/ext/opcache/tests/jit/inc_obj_003.phpt @@ -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-- +prop; +$v = --$test->prop; +var_dump($v); +?> +--EXPECT-- +float(0) \ No newline at end of file