}
}
-uint32_t zend_array_element_type(zend_op *opline, uint32_t t1)
+uint32_t zend_array_element_type(uint32_t t1, int write, int insert)
{
uint32_t tmp = 0;
- int write = (opline->opcode != ZEND_FETCH_DIM_R
- && opline->opcode != ZEND_FETCH_DIM_IS
- && opline->opcode != ZEND_FETCH_LIST_R);
if (t1 & MAY_BE_OBJECT) {
if (!write) {
}
}
if (t1 & MAY_BE_ARRAY) {
- int insert = (opline->opcode == ZEND_FETCH_DIM_W
- || opline->opcode == ZEND_FETCH_DIM_RW
- || opline->opcode == ZEND_FETCH_DIM_FUNC_ARG
- || opline->opcode == ZEND_FETCH_LIST_W)
- && opline->op2_type == IS_UNUSED;
if (insert) {
tmp |= MAY_BE_NULL;
} else {
tmp |= MAY_BE_REF;
}
orig = t1;
- t1 = zend_array_element_type(opline, t1);
+ t1 = zend_array_element_type(t1, 1, 0);
t2 = OP1_DATA_INFO();
} else {
if (t1 & MAY_BE_REF) {
COPY_SSA_OBJ_TYPE(ssa_ops[i].op1_use, ssa_ops[i].op1_def);
}
/* FETCH_LIST on a string behaves like FETCH_R on null */
- tmp = zend_array_element_type(opline,
- opline->opcode != ZEND_FETCH_LIST_R ? t1 : ((t1 & ~MAY_BE_STRING) | MAY_BE_NULL));
+ tmp = zend_array_element_type(
+ opline->opcode != ZEND_FETCH_LIST_R ? t1 : ((t1 & ~MAY_BE_STRING) | MAY_BE_NULL),
+ opline->opcode != ZEND_FETCH_DIM_R && opline->opcode != ZEND_FETCH_DIM_IS
+ && opline->opcode != ZEND_FETCH_LIST_R,
+ opline->op2_type == IS_UNUSED);
if (opline->opcode == ZEND_FETCH_DIM_W ||
opline->opcode == ZEND_FETCH_DIM_RW ||
opline->opcode == ZEND_FETCH_DIM_FUNC_ARG ||
int zend_ssa_find_sccs(const zend_op_array *op_array, zend_ssa *ssa);
int zend_ssa_inference(zend_arena **raena, const zend_op_array *op_array, const zend_script *script, zend_ssa *ssa, zend_long optimization_level);
-uint32_t zend_array_element_type(zend_op *opline, uint32_t t1);
+uint32_t zend_array_element_type(uint32_t t1, int write, int insert);
int zend_inference_calc_range(const zend_op_array *op_array, zend_ssa *ssa, int var, int widening, int narrowing, zend_ssa_range *tmp);
void zend_inference_init_range(const zend_op_array *op_array, zend_ssa *ssa, int var, zend_bool underflow, zend_long min, zend_long max, zend_bool overflow);