summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r--Zend/zend_compile.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 82da49a702..22c6ca114c 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -7298,6 +7298,9 @@ void zend_compile_array(znode *result, zend_ast *ast) /* {{{ */
return;
}
+ /* Empty arrays are handled at compile-time */
+ ZEND_ASSERT(list->children > 0);
+
for (i = 0; i < list->children; ++i) {
zend_ast *elem_ast = list->child[i];
zend_ast *value_ast, *key_ast;
@@ -7341,11 +7344,6 @@ void zend_compile_array(znode *result, zend_ast *ast) /* {{{ */
}
}
- /* Handle empty array */
- if (!list->children) {
- zend_emit_op_tmp(result, ZEND_INIT_ARRAY, NULL, NULL);
- }
-
/* Add a flag to INIT_ARRAY if we know this array cannot be packed */
if (!packed) {
ZEND_ASSERT(opnum_init != (uint32_t)-1);