Skip to content

Commit a4d769c

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: [ci skip] NEWS Fix GH-13508: JITed QM_ASSIGN may be optimized out when op1 is null (#13610)
2 parents 59e8c26 + 809446d commit a4d769c

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5074,8 +5074,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
50745074
CHECK_OP1_TRACE_TYPE();
50755075
res_info = RES_INFO();
50765076
res_use_info = zend_jit_trace_type_to_info(
5077-
STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var)))
5078-
& (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE);
5077+
STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var)));
50795078
res_addr = RES_REG_ADDR();
50805079
if (Z_MODE(res_addr) != IS_REG &&
50815080
STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var)) !=
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)