diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-10-13 14:07:37 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-10-13 14:07:37 +0400 |
commit | 7acba332fe96e5da6ad3165d0699b9e4e65d94fa (patch) | |
tree | 09eafcc95e86c5a23198a491c0ed4efbf23bd9c2 | |
parent | c96a6b44931ec54b95619d534be13a952189c4dc (diff) | |
download | php-git-7acba332fe96e5da6ad3165d0699b9e4e65d94fa.tar.gz |
We can't eliminate FETCH_CONSTANT opcodes for constants represented by AST.
-rw-r--r-- | ext/opcache/Optimizer/pass1_5.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 30705ff18a..41dde05083 100644 --- a/ext/opcache/Optimizer/pass1_5.c +++ b/ext/opcache/Optimizer/pass1_5.c @@ -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))) { |