]> granicus.if.org Git - php/commitdiff
Don't require NO_ESCAPE for partial arrays in SCCP
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 15 May 2019 13:27:17 +0000 (15:27 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 23 May 2019 07:59:25 +0000 (09:59 +0200)
ext/opcache/Optimizer/sccp.c

index 77e8083b3df9e7f9854f91c02f51d76e4d91086d..47846fec8e8edf44fdace980226fc0d99d8f57d0 100644 (file)
@@ -1135,8 +1135,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
                        if (op2 && IS_BOT(op2)) {
                                /* Update of unknown index */
                                SET_RESULT_BOT(result);
-                               if (ssa_op->op1_def >= 0
-                                               && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+                               if (ssa_op->op1_def >= 0) {
                                        empty_partial_array(&zv);
                                        SET_RESULT(op1, &zv);
                                        zval_ptr_dtor_nogc(&zv);
@@ -1153,8 +1152,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
                                                || Z_TYPE_P(op1) == IS_NULL
                                                || Z_TYPE_P(op1) == IS_FALSE
                                                || Z_TYPE_P(op1) == IS_ARRAY)
-                                       && ssa_op->op1_def >= 0
-                                       && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+                                       && ssa_op->op1_def >= 0) {
 
                                        if (Z_TYPE_P(op1) == IS_NULL || Z_TYPE_P(op1) == IS_FALSE) {
                                                empty_partial_array(&zv);
@@ -1333,8 +1331,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
                        if (op2 && IS_BOT(op2)) {
                                /* Update of unknown index */
                                SET_RESULT_BOT(op1);
-                               if (ssa_op->result_def >= 0
-                                               && ctx->scdf.ssa->vars[ssa_op->result_def].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+                               if (ssa_op->result_def >= 0) {
                                        empty_partial_array(&zv);
                                        SET_RESULT(result, &zv);
                                        zval_ptr_dtor_nogc(&zv);
@@ -1348,8 +1345,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
                                        || (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
 
                                SET_RESULT_BOT(op1);
-                               if (ssa_op->result_def >= 0
-                                               && ctx->scdf.ssa->vars[ssa_op->result_def].escape_state == ESCAPE_STATE_NO_ESCAPE) {
+                               if (ssa_op->result_def >= 0) {
                                        if (!result) {
                                                empty_partial_array(&zv);
                                        } else {
@@ -1505,9 +1501,7 @@ static void sccp_visit_instr(scdf_ctx *scdf, zend_op *opline, zend_ssa_op *ssa_o
                                }
                        } else if (opline->extended_value == ZEND_ASSIGN_DIM) {
                                if ((IS_PARTIAL_ARRAY(op1) || Z_TYPE_P(op1) == IS_ARRAY)
-                                               && ssa_op->op1_def >= 0
-                                               && ctx->scdf.ssa->vars[ssa_op->op1_def].escape_state == ESCAPE_STATE_NO_ESCAPE
-                                               && op2) {
+                                               && ssa_op->op1_def >= 0 && op2) {
                                        zval tmp;
                                        zval *data = get_op1_value(ctx, opline+1, ssa_op+1);
 
@@ -2126,7 +2120,7 @@ static void join_phi_values(zval *a, zval *b, zend_bool escape) {
                return;
        }
        if (IS_PARTIAL_ARRAY(a) || IS_PARTIAL_ARRAY(b)) {
-               if (escape || join_partial_arrays(a, b) != SUCCESS) {
+               if (join_partial_arrays(a, b) != SUCCESS) {
                        zval_ptr_dtor_nogc(a);
                        MAKE_BOT(a);
                }
@@ -2136,7 +2130,7 @@ static void join_phi_values(zval *a, zval *b, zend_bool escape) {
                        MAKE_BOT(a);
                }
        } else if (!zend_is_identical(a, b)) {
-               if (escape || join_partial_arrays(a, b) != SUCCESS) {
+               if (join_partial_arrays(a, b) != SUCCESS) {
                        zval_ptr_dtor_nogc(a);
                        MAKE_BOT(a);
                }