com php-src: Port fix to 7.0: NEWS Zend/zend_compile.c
| From: | Xinchen Hui | Date: | Mon, 23 Nov 2015 10:31:56 +0000 |
| Subject: | com php-src: Port fix to 7.0: NEWS Zend/zend_compile.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-89965@lists.php.net to get a copy of this message | ||
Commit: 51ccc88b877a7298d6bec355e3b42174485392cf
Author: Xinchen Hui <laruence@gmail.com> Mon, 23 Nov 2015 18:31:56 +0800
Parents: 397be4ff547abf7867c226feebb934d8a9a40b70
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=51ccc88b877a7298d6bec355e3b42174485392cf
Log:
Port fix to 7.0
Changed paths:
M NEWS
M Zend/zend_compile.c
Diff:
diff --git a/NEWS b/NEWS
index b3b2d50..8a0441d 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP NEWS
?? ??? 2015, PHP 7.0.1
- Core:
+ . Fixed bug #70958 (Invalid opcode while using ::class as trait method
+ paramater default value). (Laruence)
. Fixed bug #70947 (INI parser segfault with INI_SCANNER_TYPED). (Laruence)
. Fixed bug #70944 (try{ } finally{} can create infinite chains of
exceptions). (Laruence)
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 75e484f..b91fdde 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -7472,10 +7472,13 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
if (zend_try_compile_const_expr_resolve_class_name(&result, class_ast, name_ast, 0)) {
if (Z_TYPE(result) == IS_NULL) {
+ if (zend_get_class_fetch_type(zend_ast_get_str(class_ast)) == ZEND_FETCH_CLASS_SELF) {
+ zend_ast_destroy(ast);
+ *ast_ptr = zend_ast_create_ex(ZEND_AST_MAGIC_CONST, T_CLASS_C);
+ }
return;
- } else {
- break;
}
+ break;
}
zend_eval_const_expr(&class_ast);