Skip to content

Commit ef8dcbd

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: [ci skip] NEWS [ci skip] NEWS Fix GH-13508: JITed QM_ASSIGN may be optimized out when op1 is null (#13610)
2 parents 8595bea + 1b5d9f6 commit ef8dcbd

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2881,7 +2881,7 @@ static zend_jit_reg_var* zend_jit_trace_allocate_registers(zend_jit_trace_rec *t
28812881
RA_IVAL_DEL(ssa_op->op1_use);
28822882
count--;
28832883
} else if (!zend_ssa_is_no_val_use(opline, ssa_op, ssa_op->op1_use)) {
2884-
zend_jit_trace_use_var(idx, ssa_op->op1_use, ssa_op->op1_def, ssa_op->op1_use_chain,
2884+
zend_jit_trace_use_var(idx, ssa_op->op1_use, ssa_op->op1_def, ssa_op->op1_use_chain,
28852885
ra,
28862886
ssa, ssa_opcodes, op_array, op_array_ssa);
28872887
if (opline->op1_type != IS_CV) {
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
--TEST--
2+
JIT QM_ASSIGN: 004 missing type store
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=1M
8+
--FILE--
9+
<?php
10+
11+
function getPropertyScopes($props, $flags): array
12+
{
13+
$propertyScopes = [];
14+
foreach ($props as $prop) {
15+
$tmp = 'x'.$flags;
16+
$propertyScopes[] = $propertyScopes[] = ($flags & 1 ? false : null) . '';
17+
}
18+
19+
return $propertyScopes;
20+
}
21+
22+
var_dump(getPropertyScopes(['a'], 0));
23+
var_dump(getPropertyScopes(['a'], 0));
24+
?>
25+
DONE
26+
--EXPECT--
27+
array(2) {
28+
[0]=>
29+
string(0) ""
30+
[1]=>
31+
string(0) ""
32+
}
33+
array(2) {
34+
[0]=>
35+
string(0) ""
36+
[1]=>
37+
string(0) ""
38+
}
39+
DONE

0 commit comments

Comments
 (0)