diff options
| author | Xinchen Hui <laruence@gmail.com> | 2016-06-13 17:36:03 -0700 |
|---|---|---|
| committer | Xinchen Hui <laruence@gmail.com> | 2016-06-13 17:36:03 -0700 |
| commit | 6166c26f1c43d4686139c6d207a73d0ccd6b695c (patch) | |
| tree | 067385f2033aeae2ab1ee3fd568b0f6c110e1763 /Zend/zend_compile.c | |
| parent | aeb3948f3ce360f8ff77ba84a9ddef5dda522c5d (diff) | |
| download | php-git-6166c26f1c43d4686139c6d207a73d0ccd6b695c.tar.gz | |
Cleanup
Diffstat (limited to 'Zend/zend_compile.c')
| -rw-r--r-- | Zend/zend_compile.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 2b935a8f4d..63bd813092 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2762,7 +2762,10 @@ static void zend_verify_list_assign_target(zend_ast *var_ast, zend_bool old_styl static void zend_compile_unkeyed_list_assign(zend_ast_list *list, znode *expr_node, zend_bool old_style) /* {{{ */ { uint32_t i; - zend_bool has_elems = 0; + + if (list->children == 0) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot use empty list"); + } for (i = 0; i < list->children; ++i) { zend_ast *elem_ast = list->child[i]; @@ -2777,7 +2780,6 @@ static void zend_compile_unkeyed_list_assign(zend_ast_list *list, znode *expr_no } var_ast = elem_ast->child[0]; - has_elems = 1; dim_node.op_type = IS_CONST; ZVAL_LONG(&dim_node.u.constant, i); @@ -2795,10 +2797,6 @@ static void zend_compile_unkeyed_list_assign(zend_ast_list *list, znode *expr_no zend_emit_op(&fetch_result, ZEND_FETCH_LIST, expr_node, &dim_node); zend_emit_assign_znode(var_ast, &fetch_result); } - - if (!has_elems) { - zend_error_noreturn(E_COMPILE_ERROR, "Cannot use empty list"); - } } /* }}} */ |
