Skip to content

Commit 0c6999c

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: Fixed GH-12428: Assertion with function/tracing JIT
2 parents 428ecf4 + dabced0 commit 0c6999c

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
@@ -1933,7 +1933,7 @@ static void ZEND_FASTCALL zend_jit_fetch_obj_is_dynamic(zend_object *zobj, intpt
19331933
if (EXPECTED(retval)) {
19341934
intptr_t idx = (char*)retval - (char*)zobj->properties->arData;
19351935
CACHE_PTR_EX(cache_slot + 1, (void*)ZEND_ENCODE_DYN_PROP_OFFSET(idx));
1936-
ZVAL_COPY(result, retval);
1936+
ZVAL_COPY_DEREF(result, retval);
19371937
return;
19381938
}
19391939
}

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)