]> granicus.if.org Git - php/commitdiff
We can't eliminate FETCH_CONSTANT opcodes for constants represented by AST.
authorDmitry Stogov <dmitry@zend.com>
Mon, 13 Oct 2014 10:07:37 +0000 (14:07 +0400)
committerDmitry Stogov <dmitry@zend.com>
Mon, 13 Oct 2014 10:07:37 +0000 (14:07 +0400)
ext/opcache/Optimizer/pass1_5.c

index 30705ff18a84645c31e53bc5fb8984891a7142f0..41dde050835ef6442a591a7e8e2688cb9e7e1f7d 100644 (file)
@@ -252,6 +252,9 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
                                                break;
                                        }
                                }
+                               if (Z_TYPE(c) == IS_CONSTANT_AST) {
+                                       break;
+                               }
                                literal_dtor(&ZEND_OP2_LITERAL(opline));
                                MAKE_NOP(opline);
                                replace_tmp_by_const(op_array, opline, tv, &c TSRMLS_CC);
@@ -303,6 +306,9 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
                                                        Z_STRVAL(ZEND_OP2_LITERAL(opline)),
                                                        Z_STRLEN(ZEND_OP2_LITERAL(opline)) + 1,
                                                        (void **) &c) == SUCCESS) {
+                                               if (Z_TYPE_PP(c) == IS_CONSTANT_AST) {
+                                                       break;
+                                               }
                                                if (ZEND_IS_CONSTANT_TYPE(Z_TYPE_PP(c))) { 
                                                        if (!zend_get_persistent_constant(Z_STRVAL_PP(c), Z_STRLEN_PP(c), &t, 1 TSRMLS_CC) ||
                                                            ZEND_IS_CONSTANT_TYPE(Z_TYPE(t))) {