1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

JIT: Fix missing type store

Fixes oss-fuzz #50653
This commit is contained in:
Dmitry Stogov
2022-08-29 14:36:16 +03:00
parent 48d2578d41
commit 4b884bedc8
2 changed files with 25 additions and 1 deletions

View File

@@ -6377,7 +6377,7 @@ done:
}
SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->op2.var), type,
(gen_handler || type == IS_UNKNOWN || !ra ||
(!ra[ssa_op->op2_def] && !ssa->vars[ssa_op->op2_def].no_val)));
(!ra[ssa_op->op2_def] /*&& !ssa->vars[ssa_op->op2_def].no_val*/)));
if (type != IS_UNKNOWN) {
ssa->var_info[ssa_op->op2_def].type &= ~MAY_BE_GUARD;
if (ra && ra[ssa_op->op2_def]) {

View File

@@ -0,0 +1,24 @@
--TEST--
JIT ASSIGN: missing type store
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
opcache.protect_memory=1
--FILE--
<?php
function foo($a) {
$b = $a = $a + $b & $a += $a;
$b = $a = $a + $b & $b & $b = $a = $a + $b = $a = $a + $b = $a += $a;
$b = !$a = $a + $b & $b & $b = $b = $a = $a + $b & $a += $a;
$a + $b & $b & $b = $a = $a + $b = $a = $a + $b = $a += $a;
}
@foo(39087589046889428661);
@foo(390875890468877606478);
@foo(390875890468877606478);
?>
DONE
--EXPECT--
DONE