Skip to content

Commit 4b884be

Browse files
committedAug 29, 2022
JIT: Fix missing type store
Fixes oss-fuzz #50653
1 parent 48d2578 commit 4b884be

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed
 

‎ext/opcache/jit/zend_jit_trace.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -6377,7 +6377,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
63776377
}
63786378
SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op2.var), type,
63796379
(gen_handler || type == IS_UNKNOWN || !ra ||
6380-
(!ra[ssa_op->op2_def] && !ssa->vars[ssa_op->op2_def].no_val)));
6380+
(!ra[ssa_op->op2_def] /*&& !ssa->vars[ssa_op->op2_def].no_val*/)));
63816381
if (type != IS_UNKNOWN) {
63826382
ssa->var_info[ssa_op->op2_def].type &= ~MAY_BE_GUARD;
63836383
if (ra && ra[ssa_op->op2_def]) {

‎ext/opcache/tests/jit/assign_054.phpt

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
JIT ASSIGN: 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+
opcache.protect_memory=1
9+
--FILE--
10+
<?php
11+
function foo($a) {
12+
$b = $a = $a + $b & $a += $a;
13+
$b = $a = $a + $b & $b & $b = $a = $a + $b = $a = $a + $b = $a += $a;
14+
$b = !$a = $a + $b & $b & $b = $b = $a = $a + $b & $a += $a;
15+
$a + $b & $b & $b = $a = $a + $b = $a = $a + $b = $a += $a;
16+
}
17+
18+
@foo(39087589046889428661);
19+
@foo(390875890468877606478);
20+
@foo(390875890468877606478);
21+
?>
22+
DONE
23+
--EXPECT--
24+
DONE

0 commit comments

Comments
 (0)