summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2016-04-21 21:51:00 +0200
committerBob Weinand <bobwei9@hotmail.com>2016-04-21 21:51:00 +0200
commit69efeb1223916b73cc767d4c17069c8bee49365e (patch)
tree59dc9b19f0bd415cec5ffb65c3cfa190341d64f1 /Zend/zend_compile.c
parent5053fc078d2ae8ac57f1d3ff84eb31a4b2e05108 (diff)
downloadphp-git-69efeb1223916b73cc767d4c17069c8bee49365e.tar.gz
Fix constant expr coaleasce with protected mode opcache
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 20575360c3..fb196f04b5 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -7388,6 +7388,10 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
zend_ct_eval_unary_pm(&result, ast->kind, zend_ast_get_zval(ast->child[0]));
break;
case ZEND_AST_COALESCE:
+ /* Set isset fetch indicator here, opcache disallows runtime altering of the AST */
+ if (ast->child[0]->kind == ZEND_AST_DIM) {
+ ast->child[0]->attr = ZEND_DIM_IS;
+ }
zend_eval_const_expr(&ast->child[0]);
if (ast->child[0]->kind != ZEND_AST_ZVAL) {
@@ -7440,6 +7444,11 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading");
}
+ /* Set isset fetch indicator here, opcache disallows runtime altering of the AST */
+ if (ast->attr == ZEND_DIM_IS && ast->child[0]->kind == ZEND_AST_DIM) {
+ ast->child[0]->attr = ZEND_DIM_IS;
+ }
+
zend_eval_const_expr(&ast->child[0]);
zend_eval_const_expr(&ast->child[1]);
if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {