diff --git a/ext/opcache/jit/zend_jit_helpers.c b/ext/opcache/jit/zend_jit_helpers.c index 447e2269aa3..fc52986ea19 100644 --- a/ext/opcache/jit/zend_jit_helpers.c +++ b/ext/opcache/jit/zend_jit_helpers.c @@ -1938,7 +1938,7 @@ static void ZEND_FASTCALL zend_jit_fetch_obj_is_dynamic(zend_object *zobj, intpt if (EXPECTED(retval)) { intptr_t idx = (char*)retval - (char*)zobj->properties->arData; CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx)); - ZVAL_COPY(result, retval); + ZVAL_COPY_DEREF(result, retval); return; } } diff --git a/ext/opcache/tests/jit/gh12428.phpt b/ext/opcache/tests/jit/gh12428.phpt new file mode 100644 index 00000000000..48c6a30fc1b --- /dev/null +++ b/ext/opcache/tests/jit/gh12428.phpt @@ -0,0 +1,22 @@ +--TEST-- +GH-12428: Assertion with function/tracing JIT +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +--FILE-- +a; + $value->a ?? null; + } +} + +validate((object) []); +validate((object) []); +validate((object) ['b' => 0]); +?> +DONE +--EXPECT-- +DONE