This commit is contained in:
Dmitry Stogov 2020-07-16 17:09:14 +03:00
parent 7e357f470d
commit 03a98d9420
3 changed files with 4 additions and 8 deletions

View file

@ -2731,7 +2731,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
if (PROFITABILITY_CHECKS && (!ssa->ops || !ssa->var_info)) { if (PROFITABILITY_CHECKS && (!ssa->ops || !ssa->var_info)) {
break; break;
} }
if (!zend_jit_fetch_dim_read(&dasm_state, opline, op_array, if (!zend_jit_fetch_dim_read(&dasm_state, opline, op_array, ssa, ssa_op,
OP1_INFO(), OP1_REG_ADDR(), OP2_INFO(), RES_INFO(), OP1_INFO(), OP1_REG_ADDR(), OP2_INFO(), RES_INFO(),
zend_may_throw(opline, ssa_op, op_array, ssa))) { zend_may_throw(opline, ssa_op, op_array, ssa))) {
goto jit_failure; goto jit_failure;

View file

@ -3760,7 +3760,7 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
op2_info = OP2_INFO(); op2_info = OP2_INFO();
CHECK_OP2_TRACE_TYPE(); CHECK_OP2_TRACE_TYPE();
res_info = RES_INFO(); res_info = RES_INFO();
if (!zend_jit_fetch_dim_read(&dasm_state, opline, op_array, if (!zend_jit_fetch_dim_read(&dasm_state, opline, op_array, ssa, ssa_op,
op1_info, op1_addr, op2_info, res_info, op1_info, op1_addr, op2_info, res_info,
( (
(op1_info & MAY_BE_ANY) != MAY_BE_ARRAY || (op1_info & MAY_BE_ANY) != MAY_BE_ARRAY ||
@ -3774,11 +3774,6 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
(op2_info & (MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_ARRAY_OF_RESOURCE|MAY_BE_ARRAY_OF_ARRAY)) != 0)))) { (op2_info & (MAY_BE_OBJECT|MAY_BE_RESOURCE|MAY_BE_ARRAY_OF_OBJECT|MAY_BE_ARRAY_OF_RESOURCE|MAY_BE_ARRAY_OF_ARRAY)) != 0)))) {
goto jit_failure; goto jit_failure;
} }
if ((res_info & MAY_BE_GUARD)
&& JIT_G(current_frame)
&& (op1_info & (MAY_BE_ANY|MAY_BE_UNDEF)) == MAY_BE_ARRAY) {
ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD;
}
goto done; goto done;
case ZEND_ISSET_ISEMPTY_DIM_OBJ: case ZEND_ISSET_ISEMPTY_DIM_OBJ:
if ((opline->extended_value & ZEND_ISEMPTY)) { if ((opline->extended_value & ZEND_ISEMPTY)) {

View file

@ -10256,7 +10256,7 @@ static int zend_jit_zval_copy_deref(dasm_State **Dst, zend_jit_addr res_addr, ze
return 1; return 1;
} }
static int zend_jit_fetch_dim_read(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, uint32_t op1_info, zend_jit_addr op1_addr, uint32_t op2_info, uint32_t res_info, int may_throw) static int zend_jit_fetch_dim_read(dasm_State **Dst, const zend_op *opline, const zend_op_array *op_array, zend_ssa *ssa, const zend_ssa_op *ssa_op, uint32_t op1_info, zend_jit_addr op1_addr, uint32_t op2_info, uint32_t res_info, int may_throw)
{ {
zend_jit_addr orig_op1_addr, op2_addr, res_addr; zend_jit_addr orig_op1_addr, op2_addr, res_addr;
const void *exit_addr = NULL; const void *exit_addr = NULL;
@ -10314,6 +10314,7 @@ static int zend_jit_fetch_dim_read(dasm_State **Dst, const zend_op *opline, cons
} }
} }
res_info &= ~MAY_BE_GUARD; res_info &= ~MAY_BE_GUARD;
ssa->var_info[ssa_op->result_def].type &= ~MAY_BE_GUARD;
} }
if (op1_info & MAY_BE_REF) { if (op1_info & MAY_BE_REF) {