diff options
author | Bob Weinand <bobwei9@hotmail.com> | 2016-04-21 21:51:50 +0200 |
---|---|---|
committer | Bob Weinand <bobwei9@hotmail.com> | 2016-04-21 21:51:50 +0200 |
commit | 261eb5cc891735706d6c4c2f6fd43b1604751e39 (patch) | |
tree | 6cb5c27b01894fdb8ea65c4e84108f1cc2dd9284 | |
parent | 55f01863358d1d34d6abf1f37c27261208cfe965 (diff) | |
parent | 69efeb1223916b73cc767d4c17069c8bee49365e (diff) | |
download | php-git-261eb5cc891735706d6c4c2f6fd43b1604751e39.tar.gz |
Merge branch 'PHP-7.0'
-rw-r--r-- | Zend/zend_ast.c | 12 | ||||
-rw-r--r-- | Zend/zend_compile.c | 9 |
2 files changed, 9 insertions, 12 deletions
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 4d3678f0b6..3772887092 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -338,10 +338,6 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc } break; case ZEND_AST_COALESCE: - if (ast->child[0]->kind == ZEND_AST_DIM) { - ast->child[0]->attr = ZEND_DIM_IS; - } - if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) { ret = FAILURE; break; @@ -349,10 +345,6 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc if (Z_TYPE(op1) > IS_NULL) { *result = op1; } else { - if (ast->child[1]->kind == ZEND_AST_DIM) { - ast->child[1]->attr = ZEND_DIM_IS; - } - if (UNEXPECTED(zend_ast_evaluate(result, ast->child[1], scope) != SUCCESS)) { zval_dtor(&op1); ret = FAILURE; @@ -413,10 +405,6 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading"); } - if (ast->attr == ZEND_DIM_IS && ast->child[0]->kind == ZEND_AST_DIM) { - ast->child[0]->attr = ZEND_DIM_IS; - } - if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) { ret = FAILURE; } else if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) { diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index af2d2e95cb..c99cb686bf 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -7869,6 +7869,10 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */ } 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) { @@ -7921,6 +7925,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) { |