com php-src: Fixed incorrect compilation: Zend/zend_compile .c
| From: | Dmitry Stogov | Date: | Thu, 02 Oct 2014 09:37:44 +0000 |
| Subject: | com php-src: Fixed incorrect compilation: Zend/zend_compile .c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82050@lists.php.net to get a copy of this message | ||
Commit: ccb24caa6d2e8bb0a8f3959543173a1f65c84b2d
Author: Dmitry Stogov <dmitry@zend.com> Thu, 2 Oct 2014 13:37:44 +0400
Parents: c4419e7a5bcbe30f568b17164ae30799aaaa5aba
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ccb24caa6d2e8bb0a8f3959543173a1f65c84b2d
Log:
Fixed incorrect compilation
Changed paths:
M Zend/zend_compile.c
Diff:
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 41e3189..91bfbfe 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -5559,7 +5559,7 @@ void zend_compile_array(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
{
zend_ast_list *list = zend_ast_get_list(ast);
zend_op *opline;
- uint32_t i, opnum_init;
+ uint32_t i, opnum_init = -1;
zend_bool packed = 1;
if (zend_try_ct_eval_array(&result->u.constant, ast TSRMLS_CC)) {
@@ -5567,8 +5567,6 @@ void zend_compile_array(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
return;
}
- opnum_init = get_next_op_number(CG(active_op_array));
-
for (i = 0; i < list->children; ++i) {
zend_ast *elem_ast = list->child[i];
zend_ast *value_ast = elem_ast->child[0];
@@ -5591,6 +5589,7 @@ void zend_compile_array(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
}
if (i == 0) {
+ opnum_init = get_next_op_number(CG(active_op_array));
opline = zend_emit_op_tmp(result, ZEND_INIT_ARRAY, &value_node, key_node_ptr TSRMLS_CC);
opline->extended_value = list->children << ZEND_ARRAY_SIZE_SHIFT;
} else {
@@ -5612,6 +5611,7 @@ void zend_compile_array(znode *result, zend_ast *ast TSRMLS_DC) /* {{{ */
/* Add a flag to INIT_ARRAY if we know this array cannot be packed */
if (!packed) {
+ ZEND_ASSERT(opnum_init != -1);
opline = &CG(active_op_array)->opcodes[opnum_init];
opline->extended_value |= ZEND_ARRAY_NOT_PACKED;
}