Revert "Mark incorrectly used arrays and objects as escaping"

This reverts commit 9b2d3cce19.
This commit is contained in:
Dmitry Stogov 2017-09-14 00:08:43 +03:00
parent b7d683c531
commit 8e2842c306

View file

@ -243,18 +243,11 @@ static int is_escape_use(zend_op_array *op_array, zend_ssa *ssa, int use, int va
}
break;
case ZEND_ISSET_ISEMPTY_DIM_OBJ:
case ZEND_FETCH_DIM_R:
case ZEND_FETCH_DIM_IS:
if (OP1_INFO() & ((MAY_BE_ANY|MAY_BE_UNDEF)-MAY_BE_ARRAY)) {
return 1; /* incorrect type */
}
break;
case ZEND_FETCH_OBJ_R:
case ZEND_ISSET_ISEMPTY_PROP_OBJ:
case ZEND_FETCH_DIM_R:
case ZEND_FETCH_OBJ_R:
case ZEND_FETCH_DIM_IS:
case ZEND_FETCH_OBJ_IS:
if (OP1_INFO() & ((MAY_BE_ANY|MAY_BE_UNDEF)-MAY_BE_OBJECT)) {
return 1; /* incorrect type */
}
break;
case ZEND_ASSIGN_ADD:
case ZEND_ASSIGN_SUB:
@ -270,33 +263,15 @@ static int is_escape_use(zend_op_array *op_array, zend_ssa *ssa, int use, int va
case ZEND_ASSIGN_POW:
if (!opline->extended_value) {
return 1;
} else if (opline->extended_value == ZEND_ASSIGN_DIM) {
if (OP1_INFO() & ((MAY_BE_ANY|MAY_BE_UNDEF)-MAY_BE_ARRAY)) {
return 1; /* incorrect type */
}
} else if (opline->extended_value == ZEND_ASSIGN_OBJ) {
if (OP1_INFO() & ((MAY_BE_ANY|MAY_BE_UNDEF)-MAY_BE_OBJECT)) {
return 1; /* incorrect type */
}
}
break;
/* break missing intentionally */
case ZEND_ASSIGN_DIM:
if (OP1_INFO() & (MAY_BE_ANY-(MAY_BE_ARRAY|MAY_BE_NULL|MAY_BE_FALSE))) {
return 1; /* incorrect type */
}
break;
case ZEND_ASSIGN_OBJ:
if (OP1_INFO() & (MAY_BE_ANY-(MAY_BE_OBJECT|MAY_BE_NULL|MAY_BE_FALSE))) {
return 1; /* incorrect type */
}
break;
case ZEND_PRE_INC_OBJ:
case ZEND_PRE_DEC_OBJ:
case ZEND_POST_INC_OBJ:
case ZEND_POST_DEC_OBJ:
if (OP1_INFO() & ((MAY_BE_ANY|MAY_BE_UNDEF)-MAY_BE_OBJECT)) {
return 1; /* incorrect type */
}
break;
case ZEND_INIT_ARRAY:
case ZEND_ADD_ARRAY_ELEMENT: