From 8e2842c30648c9f553702beb51e828176059b029 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 14 Sep 2017 00:08:43 +0300 Subject: [PATCH] Revert "Mark incorrectly used arrays and objects as escaping" This reverts commit 9b2d3cce1946d913baba59ddd90fc7a8b3a192a4. --- ext/opcache/Optimizer/escape_analysis.c | 33 +++---------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/ext/opcache/Optimizer/escape_analysis.c b/ext/opcache/Optimizer/escape_analysis.c index 7ffdf738202..7b3e600c73d 100644 --- a/ext/opcache/Optimizer/escape_analysis.c +++ b/ext/opcache/Optimizer/escape_analysis.c @@ -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: