com php-src: Fixed another potential dangling pointer: Zend/zend_compile.c

[email protected] (Xinchen Hui)
Newsgroups php.cvs
Message-ID <[email protected]>
Commit:    b966a8b5fa70e881a12fde8b4d37461be7bf85cb
Author:    Xinchen Hui <[email protected]>         Mon, 8 May 2017 11:36:07 +0800
Parents:   87d56a3d07a337269be2e80b67766b4e94120dd8
Branches:  PHP-7.0 PHP-7.1 master

Link:       http://git.php.net/?p=php-src.git;a=commitdiff;h=b966a8b5fa70e881a12fde8b4d37461be7bf85cb

Log:
Fixed another potential dangling pointer

Changed paths:
  M  Zend/zend_compile.c


Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 7fe8815..cd45300 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -7615,8 +7615,11 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
 				break;
 			}
 
-			zend_eval_const_expr(&class_ast);
-			zend_eval_const_expr(&name_ast);
+			zend_eval_const_expr(&ast->child[0]);
+			zend_eval_const_expr(&ast->child[1]);
+
+			class_ast = ast->child[0];
+			name_ast = ast->child[1];
 
 			if (name_ast->kind == ZEND_AST_ZVAL && zend_string_equals_literal_ci(zend_ast_get_str(name_ast), "class")) {
 				zend_error_noreturn(E_COMPILE_ERROR,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.