Skip to content

Commit 191966b

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: Fixed GH-12428: Assertion with function/tracing JIT
2 parents 47c6b3b + d2cf3a4 commit 191966b

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1931,7 +1931,7 @@ static void ZEND_FASTCALL zend_jit_fetch_obj_is_dynamic(zend_object *zobj, intpt
19311931
if (EXPECTED(retval)) {
19321932
intptr_t idx = (char*)retval - (char*)zobj->properties->arData;
19331933
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
1934-
ZVAL_COPY(result, retval);
1934+
ZVAL_COPY_DEREF(result, retval);
19351935
return;
19361936
}
19371937
}

ext/opcache/tests/jit/gh12428.phpt

Lines changed: 22 additions & 0 deletions
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)