com php-src: Fixed compile-time constants substitution: Zend/zend_compile.c

From: Date: Tue, 26 Aug 2014 09:06:19 +0000
Subject: com php-src: Fixed compile-time constants substitution: Zend/zend_compile.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-81119@lists.php.net to get a copy of this message
Commit: 7cbbb371270fe369eb30a570df95bbdcf42a82e4 Author: Dmitry Stogov <dmitry@zend.com> Tue, 26 Aug 2014 13:06:19 +0400 Parents: c2cb2cb9f8f6f9b30cb3965d474c3a2d3348f572 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7cbbb371270fe369eb30a570df95bbdcf42a82e4 Log: Fixed compile-time constants substitution Changed paths: M Zend/zend_compile.c Diff: diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index aee6158..81c0596 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2800,8 +2800,7 @@ static int zend_constant_ct_subst(znode *result, zval *const_name, int all_inter if (c) { result->op_type = IS_CONST; - result->u.constant = c->value; - zval_copy_ctor(&result->u.constant); + ZVAL_DUP(&result->u.constant, &c->value); return 1; } return 0; @@ -7661,6 +7660,16 @@ void zend_eval_const_expr(zend_ast **ast_ptr TSRMLS_DC) { return; } break; + case ZEND_AST_CONST: { + znode result_node; + + if (!zend_constant_ct_subst(&result_node, zend_ast_get_zval(ast->child[0]), 0 TSRMLS_CC)) { + return; + } + zend_ast_destroy(ast); + *ast_ptr = zend_ast_create_zval(&result_node.u.constant); + return; + } default: return; }

« previous php.cvs (#81119) next »