com php-src: Initialize hash as unpacked if it contains string keys: Zend/zend_compile.c Zend/zend_vm_def.h Zend/zend _vm_execute.h
| From: | Dmitry Stogov | Date: | Tue, 22 Apr 2014 19:33:49 +0000 |
| Subject: | com php-src: Initialize hash as unpacked if it contains string keys: Zend/zend_compile.c Zend/zend_vm_def.h Zend/zend _vm_execute.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77300@lists.php.net to get a copy of this message | ||
Commit: 9c70603f4aab770cc629dedacfd5a6a3c0d1f46e
Author: Nikita Popov <nikic@php.net> Tue, 22 Apr 2014 21:33:49 +0200
Parents: 4912bec514b23cc93ff6932128ed8b420e15ea78
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9c70603f4aab770cc629dedacfd5a6a3c0d1f46e
Log:
Initialize hash as unpacked if it contains string keys
Changed paths:
M Zend/zend_compile.c
M Zend/zend_vm_def.h
M Zend/zend_vm_execute.h
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index c184de5..4844128 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5853,16 +5853,17 @@ void zend_do_init_array(znode *result, znode *expr, znode *offset, zend_bool is_ opline->opcode = ZEND_INIT_ARRAY; opline->result.var = get_temporary_variable(CG(active_op_array)); opline->result_type = IS_TMP_VAR; - opline->extended_value = is_ref; /* extval = size << 1 | is_ref */ + opline->extended_value = is_ref; /* extval = size << 2 | not_packed << 1 | is_ref */ if (expr) { - opline->extended_value += 1 << 1; + opline->extended_value += 1 << 2; /* increment size */ SET_NODE(opline->op1, expr); if (offset) { SET_NODE(opline->op2, offset); if (opline->op2_type == IS_CONST && Z_TYPE(CONSTANT(opline->op2.constant)) == IS_STRING) { ulong index; int numeric = 0; + opline->extended_value |= 1 << 1; /* string key -> not packed */ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))+1, index, numeric = 1); if (numeric) { @@ -5884,7 +5885,7 @@ void zend_do_add_array_element(znode *result, znode *expr, znode *offset, zend_b { zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); zend_op *init_opline = &CG(active_op_array)->opcodes[result->u.op.opline_num]; - init_opline->extended_value += 1 << 1; /* extval = size << 1 | is_first_ref */ + init_opline->extended_value += 1 << 2; /* increment size */ opline->opcode = ZEND_ADD_ARRAY_ELEMENT; COPY_NODE(opline->result, init_opline->result); @@ -5894,6 +5895,7 @@ void zend_do_add_array_element(znode *result, znode *expr, znode *offset, zend_b if (opline->op2_type == IS_CONST && Z_TYPE(CONSTANT(opline->op2.constant)) == IS_STRING) { ulong index; int numeric = 0; + init_opline->extended_value |= 1 << 1; /* string key -> not packed */ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))+1, index, numeric = 1); if (numeric) { diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 2341a95..bfb46b2 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -3725,7 +3725,19 @@ ZEND_VM_HANDLER(71, ZEND_INIT_ARRAY, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|UNUS { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (OP1_TYPE != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (OP1_TYPE == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if !defined(ZEND_VM_SPEC) || OP1_TYPE != IS_UNUSED diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 65bd638..f947c82 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4000,7 +4000,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_H { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CONST != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CONST == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CONST != IS_UNUSED @@ -4832,7 +4844,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CONST != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CONST == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CONST != IS_UNUSED @@ -5623,7 +5647,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CONST != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CONST == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CONST != IS_UNUSED @@ -6256,7 +6292,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_ { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CONST != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CONST == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CONST != IS_UNUSED @@ -7122,7 +7170,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HAND { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CONST != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CONST == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CONST != IS_UNUSED @@ -8894,7 +8954,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_TMP_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_TMP_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_TMP_VAR != IS_UNUSED @@ -9690,7 +9762,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDL { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_TMP_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_TMP_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_TMP_VAR != IS_UNUSED @@ -10481,7 +10565,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDL { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_TMP_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_TMP_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_TMP_VAR != IS_UNUSED @@ -11000,7 +11096,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HA { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_TMP_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_TMP_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_TMP_VAR != IS_UNUSED @@ -11793,7 +11901,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLE { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_TMP_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_TMP_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_TMP_VAR != IS_UNUSED @@ -15115,7 +15235,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_VAR != IS_UNUSED @@ -17186,7 +17318,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_VAR != IS_UNUSED @@ -19318,7 +19462,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_VAR != IS_UNUSED @@ -20703,7 +20859,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_VAR != IS_UNUSED @@ -22591,7 +22759,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_VAR != IS_UNUSED @@ -23995,7 +24175,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_ { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_UNUSED != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_UNUSED == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_UNUSED != IS_UNUSED @@ -25234,7 +25426,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HA { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_UNUSED != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_UNUSED == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_UNUSED != IS_UNUSED @@ -26475,7 +26679,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HA { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_UNUSED != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_UNUSED == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_UNUSED != IS_UNUSED @@ -27226,7 +27442,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_UNUSED != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_UNUSED == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_UNUSED != IS_UNUSED @@ -28203,7 +28431,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_UNUSED != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_UNUSED == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_UNUSED != IS_UNUSED @@ -31394,7 +31634,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CV != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CV == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CV != IS_UNUSED @@ -33348,7 +33600,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CV != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CV == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CV != IS_UNUSED @@ -35362,7 +35626,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CV != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CV == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CV != IS_UNUSED @@ -36631,7 +36907,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CV != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CV == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CV != IS_UNUSED @@ -38383,7 +38671,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CV != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CV == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CV != IS_UNUSED
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index c184de5..4844128 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -5853,16 +5853,17 @@ void zend_do_init_array(znode *result, znode *expr, znode *offset, zend_bool is_ opline->opcode = ZEND_INIT_ARRAY; opline->result.var = get_temporary_variable(CG(active_op_array)); opline->result_type = IS_TMP_VAR; - opline->extended_value = is_ref; /* extval = size << 1 | is_ref */ + opline->extended_value = is_ref; /* extval = size << 2 | not_packed << 1 | is_ref */ if (expr) { - opline->extended_value += 1 << 1; + opline->extended_value += 1 << 2; /* increment size */ SET_NODE(opline->op1, expr); if (offset) { SET_NODE(opline->op2, offset); if (opline->op2_type == IS_CONST && Z_TYPE(CONSTANT(opline->op2.constant)) == IS_STRING) { ulong index; int numeric = 0; + opline->extended_value |= 1 << 1; /* string key -> not packed */ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))+1, index, numeric = 1); if (numeric) { @@ -5884,7 +5885,7 @@ void zend_do_add_array_element(znode *result, znode *expr, znode *offset, zend_b { zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC); zend_op *init_opline = &CG(active_op_array)->opcodes[result->u.op.opline_num]; - init_opline->extended_value += 1 << 1; /* extval = size << 1 | is_first_ref */ + init_opline->extended_value += 1 << 2; /* increment size */ opline->opcode = ZEND_ADD_ARRAY_ELEMENT; COPY_NODE(opline->result, init_opline->result); @@ -5894,6 +5895,7 @@ void zend_do_add_array_element(znode *result, znode *expr, znode *offset, zend_b if (opline->op2_type == IS_CONST && Z_TYPE(CONSTANT(opline->op2.constant)) == IS_STRING) { ulong index; int numeric = 0; + init_opline->extended_value |= 1 << 1; /* string key -> not packed */ ZEND_HANDLE_NUMERIC_EX(Z_STRVAL(CONSTANT(opline->op2.constant)), Z_STRLEN(CONSTANT(opline->op2.constant))+1, index, numeric = 1); if (numeric) { diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 2341a95..bfb46b2 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -3725,7 +3725,19 @@ ZEND_VM_HANDLER(71, ZEND_INIT_ARRAY, CONST|TMP|VAR|UNUSED|CV, CONST|TMP|VAR|UNUS { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (OP1_TYPE != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (OP1_TYPE == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if !defined(ZEND_VM_SPEC) || OP1_TYPE != IS_UNUSED diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 65bd638..f947c82 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4000,7 +4000,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_H { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CONST != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CONST == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CONST != IS_UNUSED @@ -4832,7 +4844,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CONST != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CONST == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CONST != IS_UNUSED @@ -5623,7 +5647,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CONST != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CONST == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CONST != IS_UNUSED @@ -6256,7 +6292,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_ { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CONST != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CONST == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CONST != IS_UNUSED @@ -7122,7 +7170,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HAND { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CONST != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CONST == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CONST != IS_UNUSED @@ -8894,7 +8954,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_TMP_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_TMP_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_TMP_VAR != IS_UNUSED @@ -9690,7 +9762,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDL { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_TMP_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_TMP_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_TMP_VAR != IS_UNUSED @@ -10481,7 +10565,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDL { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_TMP_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_TMP_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_TMP_VAR != IS_UNUSED @@ -11000,7 +11096,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HA { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_TMP_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_TMP_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_TMP_VAR != IS_UNUSED @@ -11793,7 +11901,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLE { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_TMP_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_TMP_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_TMP_VAR != IS_UNUSED @@ -15115,7 +15235,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_VAR != IS_UNUSED @@ -17186,7 +17318,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDL { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_VAR != IS_UNUSED @@ -19318,7 +19462,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDL { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_VAR != IS_UNUSED @@ -20703,7 +20859,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HA { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_VAR != IS_UNUSED @@ -22591,7 +22759,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLE { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_VAR != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_VAR == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_VAR != IS_UNUSED @@ -23995,7 +24175,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_ { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_UNUSED != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_UNUSED == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_UNUSED != IS_UNUSED @@ -25234,7 +25426,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HA { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_UNUSED != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_UNUSED == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_UNUSED != IS_UNUSED @@ -26475,7 +26679,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HA { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_UNUSED != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_UNUSED == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_UNUSED != IS_UNUSED @@ -27226,7 +27442,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_UNUSED != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_UNUSED == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_UNUSED != IS_UNUSED @@ -28203,7 +28431,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_UNUSED != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_UNUSED == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_UNUSED != IS_UNUSED @@ -31394,7 +31634,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HAND { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CV != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CV == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CV != IS_UNUSED @@ -33348,7 +33600,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLE { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CV != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CV == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CV != IS_UNUSED @@ -35362,7 +35626,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLE { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CV != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CV == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CV != IS_UNUSED @@ -36631,7 +36907,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HAN { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CV != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CV == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CV != IS_UNUSED @@ -38383,7 +38671,19 @@ static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER { USE_OPLINE - array_init_size(EX_VAR(opline->result.var), opline->extended_value >> 1); + ZVAL_NEW_ARR(EX_VAR(opline->result.var)); + zend_hash_init( + Z_ARRVAL_P(EX_VAR(opline->result.var)), + opline->extended_value >> 2, NULL, ZVAL_PTR_DTOR, 0 + ); + + if (IS_CV != IS_UNUSED) { + /* Explicitly initialize array as not-packed if flag is set */ + if (opline->extended_value & (1 << 1)) { + zend_hash_real_init(Z_ARRVAL_P(EX_VAR(opline->result.var)), 0); + } + } + if (IS_CV == IS_UNUSED) { ZEND_VM_NEXT_OPCODE(); #if 0 || IS_CV != IS_UNUSED