summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2016-06-17 09:34:15 -0700
committerXinchen Hui <laruence@gmail.com>2016-06-17 09:34:15 -0700
commitfcd8a5ca65452db19ca8ef197fa63a1ec9c2f0a0 (patch)
tree49dad6192fd8ce3c907f7a82f924f59ae94ff6eb /Zend/zend_compile.c
parent08f0345d0a25684c9b5e9e7587ab6ed22a4dfd4b (diff)
downloadphp-git-fcd8a5ca65452db19ca8ef197fa63a1ec9c2f0a0.tar.gz
Fixed bug #72441 (Segmentation fault: RFC list_keys)
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 02507f2366..1d544c6561 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -2819,6 +2819,10 @@ static void zend_compile_keyed_list_assign(zend_ast_list *list, znode *expr_node
zend_error(E_COMPILE_ERROR, "[] and list() assignments cannot be by reference");
}
+ if (key_ast == NULL) {
+ zend_error(E_COMPILE_ERROR, "Cannot mix keyed and unkeyed array entries in assignments");
+ }
+
zend_compile_expr(&dim_node, key_ast);
if (expr_node->op_type == IS_CONST) {
@@ -2829,10 +2833,6 @@ static void zend_compile_keyed_list_assign(zend_ast_list *list, znode *expr_node
zend_error(E_COMPILE_ERROR, "Cannot use empty array entries in keyed array");
}
- if (key_ast == NULL) {
- zend_error(E_COMPILE_ERROR, "Cannot mix keyed and unkeyed array entries in assignments");
- }
-
zend_verify_list_assign_target(var_ast, old_style);
zend_emit_op(&fetch_result, ZEND_FETCH_LIST, expr_node, &dim_node);