Skip to content

Commit

Permalink
Merge branch 'PHP-8.0' into PHP-8.1
Browse files Browse the repository at this point in the history
* PHP-8.0:
  JIT: Fix missing type store
  • Loading branch information
dstogov committed Mar 21, 2022
2 parents 2198493 + e9fc81a commit 21b0da8
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ext/opcache/jit/zend_jit_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -4982,9 +4982,16 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
res_use_info = zend_jit_trace_type_to_info(
STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var)))
& (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_LONG|MAY_BE_DOUBLE);
res_addr = RES_REG_ADDR();
if (Z_MODE(res_addr) != IS_REG &&
STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var)) !=
STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var))) {
/* type may be not set */
res_use_info |= MAY_BE_NULL;
}
if (!zend_jit_qm_assign(&dasm_state, opline,
op1_info, op1_addr, op1_def_addr,
res_use_info, res_info, RES_REG_ADDR())) {
res_use_info, res_info, res_addr)) {
goto jit_failure;
}
if (opline->op1_type == IS_CV
Expand Down
26 changes: 26 additions & 0 deletions ext/opcache/tests/jit/qm_assign_003.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
--TEST--
JIT QM_ASSIGN: 003 missing type store
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
--FILE--
<?php
function foo() {
for($cnt2=0;$cnt<6;$cnt++) {
$a &= 15;
$a = "4294967295";
$a *= $a;
for ($i = 0; $i <= .1; $i++) {
for ($i = 0; $i << .1; $i++) {
$a &= $a . $a = "4294967295";
}
}
}
}
@foo();
?>
DONE
--EXPECT--
DONE

0 comments on commit 21b0da8

Please sign in to comment.