USE_OPLINE
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && is_ref) {
+ if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = opline->op1.zv;
if (0) { /* temporary variable */
if (IS_CONST != IS_UNUSED) {
zval *offset = opline->op2.zv;
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_CONST != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_CONST != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && is_ref) {
+ if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = opline->op1.zv;
if (0) { /* temporary variable */
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_TMP_VAR != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
zval_dtor(free_op2.var);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_CONST != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && is_ref) {
+ if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = opline->op1.zv;
if (0) { /* temporary variable */
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_VAR != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
zval_ptr_dtor_nogc(free_op2.var);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_CONST != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && is_ref) {
+ if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = opline->op1.zv;
if (0) { /* temporary variable */
if (IS_UNUSED != IS_UNUSED) {
zval *offset = NULL;
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_UNUSED != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_CONST != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && is_ref) {
+ if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
if (IS_CONST == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = opline->op1.zv;
if (0) { /* temporary variable */
if (IS_CV != IS_UNUSED) {
zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_CV != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_CONST == IS_VAR || IS_CONST == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CONST_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_CONST != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zend_free_op free_op1;
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && is_ref) {
+ if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (1) { /* temporary variable */
if (IS_CONST != IS_UNUSED) {
zval *offset = opline->op2.zv;
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_CONST != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_TMP_VAR != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zend_free_op free_op1;
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && is_ref) {
+ if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (1) { /* temporary variable */
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_TMP_VAR != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
zval_dtor(free_op2.var);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_TMP_VAR != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zend_free_op free_op1;
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && is_ref) {
+ if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (1) { /* temporary variable */
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_VAR != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
zval_ptr_dtor_nogc(free_op2.var);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_TMP_VAR != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zend_free_op free_op1;
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && is_ref) {
+ if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (1) { /* temporary variable */
if (IS_UNUSED != IS_UNUSED) {
zval *offset = NULL;
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_UNUSED != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_TMP_VAR != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zend_free_op free_op1;
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && is_ref) {
+ if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = NULL;
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (1) { /* temporary variable */
if (IS_CV != IS_UNUSED) {
zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_CV != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_TMP_VAR != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zend_free_op free_op1;
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && is_ref) {
+ if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+ if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
} else {
expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (0) { /* temporary variable */
if (IS_CONST != IS_UNUSED) {
zval *offset = opline->op2.zv;
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_CONST != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
}
- if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && is_ref) {
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_VAR != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zend_free_op free_op1;
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && is_ref) {
+ if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+ if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
} else {
expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (0) { /* temporary variable */
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_TMP_VAR != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
}
- if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && is_ref) {
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_VAR != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zend_free_op free_op1;
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && is_ref) {
+ if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+ if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
} else {
expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (0) { /* temporary variable */
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_VAR != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
}
- if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && is_ref) {
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_VAR != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zend_free_op free_op1;
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && is_ref) {
+ if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+ if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
} else {
expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (0) { /* temporary variable */
if (IS_UNUSED != IS_UNUSED) {
zval *offset = NULL;
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_UNUSED != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
}
- if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && is_ref) {
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_VAR != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zend_free_op free_op1;
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && is_ref) {
+ if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+ if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
} else {
expr_ptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (0) { /* temporary variable */
if (IS_CV != IS_UNUSED) {
zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_CV != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
}
- if ((IS_VAR == IS_VAR || IS_VAR == IS_CV) && is_ref) {
- if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
- }
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_VAR != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_UNUSED != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_UNUSED != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_UNUSED != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_UNUSED != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_UNUSED != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_CV == IS_VAR || IS_CV == IS_CV) && is_ref) {
+ if ((IS_CV == IS_VAR || IS_CV == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
if (0) { /* temporary variable */
if (IS_CONST != IS_UNUSED) {
zval *offset = opline->op2.zv;
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_CONST != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_CV == IS_VAR || IS_CV == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_CV != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_CV == IS_VAR || IS_CV == IS_CV) && is_ref) {
+ if ((IS_CV == IS_VAR || IS_CV == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
if (0) { /* temporary variable */
if (IS_TMP_VAR != IS_UNUSED) {
zend_free_op free_op2;
zval *offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_TMP_VAR != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
zval_dtor(free_op2.var);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_CV == IS_VAR || IS_CV == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_CV != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_CV == IS_VAR || IS_CV == IS_CV) && is_ref) {
+ if ((IS_CV == IS_VAR || IS_CV == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
if (0) { /* temporary variable */
if (IS_VAR != IS_UNUSED) {
zend_free_op free_op2;
zval *offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_VAR != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
zval_ptr_dtor_nogc(free_op2.var);
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_CV == IS_VAR || IS_CV == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_CV != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_CV == IS_VAR || IS_CV == IS_CV) && is_ref) {
+ if ((IS_CV == IS_VAR || IS_CV == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
if (0) { /* temporary variable */
if (IS_UNUSED != IS_UNUSED) {
zval *offset = NULL;
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_UNUSED != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_CV == IS_VAR || IS_CV == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_CV != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}
USE_OPLINE
zval *expr_ptr, new_expr;
- zend_bool is_ref = opline->extended_value & 1;
SAVE_OPLINE();
- if ((IS_CV == IS_VAR || IS_CV == IS_CV) && is_ref) {
+ if ((IS_CV == IS_VAR || IS_CV == IS_CV) &&
+ (opline->extended_value & ZEND_ARRAY_ELEMENT_REF)) {
expr_ptr = _get_zval_ptr_cv_BP_VAR_W(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_VAR && UNEXPECTED(Z_TYPE_P(expr_ptr) == IS_STR_OFFSET)) {
zend_error_noreturn(E_ERROR, "Cannot create references to/from string offsets");
}
SEPARATE_ZVAL_TO_MAKE_IS_REF(expr_ptr);
Z_ADDREF_P(expr_ptr);
+
} else {
expr_ptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
if (0) { /* temporary variable */
if (IS_CV != IS_UNUSED) {
zval *offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
+ zend_string *str;
ulong hval;
add_again:
zend_hash_index_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), hval, expr_ptr);
break;
case IS_STRING:
+ str = Z_STR_P(offset);
if (IS_CV != IS_CONST) {
- ZEND_HANDLE_NUMERIC_EX(Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval, goto num_index);
+ ZEND_HANDLE_NUMERIC_EX(str->val, str->len+1, hval, goto num_index);
}
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), Z_STR_P(offset), expr_ptr);
+str_index:
+ zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), str, expr_ptr);
break;
case IS_NULL:
- zend_hash_update(Z_ARRVAL_P(EX_VAR(opline->result.var)), STR_EMPTY_ALLOC(), expr_ptr);
- break;
+ str = STR_EMPTY_ALLOC();
+ goto str_index;
case IS_REFERENCE:
offset = Z_REFVAL_P(offset);
goto add_again;
} else {
zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr);
- }
- if ((IS_CV == IS_VAR || IS_CV == IS_CV) && is_ref) {
-
}
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
static int ZEND_FASTCALL ZEND_INIT_ARRAY_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
{
+ zval *array;
+ zend_uint size;
USE_OPLINE
- 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
- );
+ array = EX_VAR(opline->result.var);
+ if (IS_CV != IS_UNUSED) {
+ size = opline->extended_value >> ZEND_ARRAY_SIZE_SHIFT;
+ } else {
+ size = 0;
+ }
+ ZVAL_NEW_ARR(array);
+ zend_hash_init(Z_ARRVAL_P(array), size, 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 (opline->extended_value & ZEND_ARRAY_NOT_PACKED) {
+ zend_hash_real_init(Z_ARRVAL_P(array), 0);
}
}