diff options
author | Xinchen Hui <laruence@gmail.com> | 2017-05-08 11:32:08 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@gmail.com> | 2017-05-08 11:32:08 +0800 |
commit | 87d56a3d07a337269be2e80b67766b4e94120dd8 (patch) | |
tree | 76f8a7e73b10d2c34ecb4b7c0b396b5ee41ac32f | |
parent | 5c957b502e92ab32f44e449dd6ceed573cc65bf5 (diff) | |
download | php-git-87d56a3d07a337269be2e80b67766b4e94120dd8.tar.gz |
Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST_HANDLER())
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | Zend/tests/bug74546.phpt | 11 | ||||
-rw-r--r-- | Zend/zend_compile.c | 7 |
3 files changed, 20 insertions, 2 deletions
@@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2017 PHP 7.0.20 +- Core: + . Fixed bug #74546 (SIGILL in ZEND_FETCH_CLASS_CONSTANT_SPEC_CONST_CONST). + (Laruence) + - intl: . Fixed bug #74468 (wrong reflection on Collator::sortWithSortKeys). (villfa) 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 9e0621d783..7fe8815e81 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -6669,8 +6669,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) { resolved_name = zend_resolve_class_name_ast(class_ast); |