1
0
mirror of https://github.com/php/php-src.git synced 2026-04-10 01:23:53 +02:00

Merge branch 'PHP-8.1'

* PHP-8.1:
  Tracing JIT: Fixed incorrect assumption about stack slot type
This commit is contained in:
Dmitry Stogov
2022-04-11 11:45:32 +03:00
3 changed files with 25 additions and 0 deletions

View File

@@ -562,6 +562,9 @@ typedef union _zend_jit_trace_stack {
(_stack)[_slot].reg = _reg; \
(_stack)[_slot].flags = _flags; \
} while (0)
#define RESET_STACK_MEM_TYPE(_stack, _slot) do { \
(_stack)[_slot].mem_type = IS_UNKNOWN; \
} while (0)
/* trace info flags */
#define ZEND_JIT_TRACE_CHECK_INTERRUPT (1<<0)

View File

@@ -6229,6 +6229,9 @@ done:
} else {
SET_STACK_TYPE(stack, EX_VAR_TO_NUM(opline->result.var), type,
(type == IS_UNKNOWN || !ra || !ra[ssa_op->result_def]));
if (ssa->var_info[ssa_op->result_def].type & MAY_BE_INDIRECT) {
RESET_STACK_MEM_TYPE(stack, EX_VAR_TO_NUM(opline->result.var));
}
if (type != IS_UNKNOWN) {
ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD;
if (opline->opcode == ZEND_FETCH_THIS

View File

@@ -0,0 +1,19 @@
--TEST--
JIT FETCH_DIM_R: 014
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
--FILE--
<?php
function foo() {
$s =+ $y;
$tokenthiss[$i=$s][] = $y = $y;
$tokenthiss[$i][$i] + $y;
}
@foo();
?>
DONE
--EXPECT--
DONE