Skip to content

Commit dabced0

Browse files
committed
Fixed GH-12428: Assertion with function/tracing JIT
1 parent 68aa793 commit dabced0

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

ext/opcache/jit/zend_jit_helpers.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1938,7 +1938,7 @@ static void ZEND_FASTCALL zend_jit_fetch_obj_is_dynamic(zend_object *zobj, intpt
19381938
if (EXPECTED(retval)) {
19391939
intptr_t idx = (char*)retval - (char*)zobj->properties->arData;
19401940
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
1941-
ZVAL_COPY(result, retval);
1941+
ZVAL_COPY_DEREF(result, retval);
19421942
return;
19431943
}
19441944
}

ext/opcache/tests/jit/gh12428.phpt

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
GH-12428: Assertion with function/tracing JIT
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
--FILE--
7+
<?php
8+
function validate($value)
9+
{
10+
foreach ([0] as $_) {
11+
$a = &$value->a;
12+
$value->a ?? null;
13+
}
14+
}
15+
16+
validate((object) []);
17+
validate((object) []);
18+
validate((object) ['b' => 0]);
19+
?>
20+
DONE
21+
--EXPECT--
22+
DONE

0 commit comments

Comments
 (0)