diff options
author | Xinchen Hui <laruence@gmail.com> | 2017-05-08 11:32:27 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2017-05-08 11:32:27 +0800 |
commit | 2c070847e7a9f88a3c87171fa64dea53f70e1560 (patch) | |
tree | 7d98c6611b8389bf2297903d3bb696930890f23c | |
parent | 5dafb523fd20c2d8ce10eabec4f1881a6af8fbe9 (diff) | |
parent | 87d56a3d07a337269be2e80b67766b4e94120dd8 (diff) | |
download | php-git-2c070847e7a9f88a3c87171fa64dea53f70e1560.tar.gz |
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER())
-rw-r--r-- | Zend/tests/bug74546.phpt | 11 | ||||
-rw-r--r-- | Zend/zend_compile.c | 7 |
2 files changed, 16 insertions, 2 deletions
diff --git a/Zend/tests/bug74546.phpt b/Zend/tests/bug74546.phpt new file mode 100644 index 0000000000..9c1582ad4f --- /dev/null +++ b/Zend/tests/bug74546.phpt @@ -0,0 +1,11 @@ +--TEST-- +Bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER()) +--FILE-- +<?php +"000000"[0]::d; +?> +--EXPECTF-- +Fatal error: Uncaught Error: Class '0' not found in %sbug74546.php:%d +Stack trace: +#0 {main} + thrown in %sbug74546.php on line %d diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 98e75c500c..27d4a7bb04 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -7370,8 +7370,11 @@ void zend_compile_class_const(znode *result, zend_ast *ast) /* {{{ */ return; } - zend_eval_const_expr(&class_ast); - zend_eval_const_expr(&const_ast); + zend_eval_const_expr(&ast->child[0]); + zend_eval_const_expr(&ast->child[1]); + + class_ast = ast->child[0]; + const_ast = ast->child[1]; if (class_ast->kind == ZEND_AST_ZVAL) { zend_string *resolved_name; |