obj = opline->op1.zv;
if (IS_CONST == IS_CONST ||
- UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
+ (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) {
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
container = opline->op1.zv;
offset = opline->op2.zv;
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
container = opline->op1.zv;
offset = opline->op2.zv;
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = opline->op1.zv;
offset = opline->op2.zv;
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_CONST != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_CONST == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = opline->op1.zv;
offset = opline->op2.zv;
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_CONST == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = opline->op1.zv;
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
container = opline->op1.zv;
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = opline->op1.zv;
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_CONST != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_CONST == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = opline->op1.zv;
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_CONST == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = opline->op1.zv;
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
container = opline->op1.zv;
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = opline->op1.zv;
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_CONST != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_CONST == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = opline->op1.zv;
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_CONST == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = opline->op1.zv;
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
container = opline->op1.zv;
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_CONST == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CONST, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
if (IS_CONST == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = opline->op1.zv;
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_CONST != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_CONST == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = opline->op1.zv;
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_CONST == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
obj = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (IS_TMP_VAR == IS_CONST ||
- UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
+ (IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) {
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = opline->op2.zv;
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = opline->op2.zv;
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_TMP_VAR, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = opline->op2.zv;
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_TMP_VAR != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_TMP_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = opline->op2.zv;
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_TMP_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_TMP_VAR, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_TMP_VAR != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_TMP_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_TMP_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_TMP_VAR, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_TMP_VAR != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_TMP_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_TMP_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_TMP_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_TMP_VAR, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
if (IS_TMP_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
object = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_TMP_VAR != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_TMP_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_TMP_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
obj = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (IS_VAR == IS_CONST ||
- UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
+ (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) {
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_VAR != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_VAR == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_VAR != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (RETURN_VALUE_USED(opline)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_VAR != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = opline->op2.zv;
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = opline->op2.zv;
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, IS_VAR, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
/* assign_obj has two opcodes! */
zval *property_name = opline->op2.zv;
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, IS_VAR, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
} else {
zend_free_op free_op_data1, free_op_data2;
object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
}
offset = opline->op2.zv;
- switch (Z_TYPE_P(container)) {
- case IS_ARRAY: {
- HashTable *ht = Z_ARRVAL_P(container);
+ if (IS_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
+ HashTable *ht = Z_ARRVAL_P(container);
offset_again:
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
- break;
- case IS_LONG:
- hval = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ hval = zend_dval_to_lval(Z_DVAL_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_LONG:
+ hval = Z_LVAL_P(offset);
num_index_dim:
- zend_hash_index_del(ht, hval);
- break;
- case IS_STRING:
- if (IS_CONST != IS_CONST) {
- if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
- goto num_index_dim;
- }
- }
- if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
- } else {
- zend_hash_del(ht, Z_STR_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_STRING:
+ if (IS_CONST != IS_CONST) {
+ if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
+ goto num_index_dim;
}
- break;
- case IS_NULL:
- zend_hash_del(ht, STR_EMPTY_ALLOC());
- break;
- case IS_FALSE:
- hval = 0;
- goto num_index_dim;
- case IS_TRUE:
- hval = 1;
- goto num_index_dim;
- case IS_RESOURCE:
- hval = Z_RES_HANDLE_P(offset);
- goto num_index_dim;
- case IS_REFERENCE:
- offset = Z_REFVAL_P(offset);
- goto offset_again;
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in unset");
- break;
- }
+ }
+ if (ht == &EG(symbol_table).ht) {
+ zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ } else {
+ zend_hash_del(ht, Z_STR_P(offset));
+ }
+ break;
+ case IS_NULL:
+ zend_hash_del(ht, STR_EMPTY_ALLOC());
+ break;
+ case IS_FALSE:
+ hval = 0;
+ goto num_index_dim;
+ case IS_TRUE:
+ hval = 1;
+ goto num_index_dim;
+ case IS_RESOURCE:
+ hval = Z_RES_HANDLE_P(offset);
+ goto num_index_dim;
+ case IS_REFERENCE:
+ offset = Z_REFVAL_P(offset);
+ goto offset_again;
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in unset");
+ break;
+ }
- break;
+ } else if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot use object as array");
}
- case IS_OBJECT:
- if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use object as array");
- }
-//??? if (IS_CONST == IS_CONST) {
-//??? zval_copy_ctor(offset);
-//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+//??? if (IS_CONST == IS_CONST) {
+//??? zval_copy_ctor(offset);
+//??? }
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- break;
- case IS_STRING:
- zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
- ZEND_VM_CONTINUE(); /* bailed out before */
- default:
+ } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ ZEND_VM_CONTINUE(); /* bailed out before */
+ } else {
- break;
}
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
CHECK_EXCEPTION();
offset = opline->op2.zv;
ZVAL_DEREF(container);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = opline->op2.zv;
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_VAR != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = opline->op2.zv;
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_VAR != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
FREE_OP(free_op_data1);
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_VAR == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_VAR != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
if (RETURN_VALUE_USED(opline)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_VAR != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
ZVAL_NULL(retval);
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, IS_VAR, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
/* assign_obj has two opcodes! */
zend_free_op free_op2;
zval *property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, IS_VAR, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
} else {
zend_free_op free_op2, free_op_data1, free_op_data2;
object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
}
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- switch (Z_TYPE_P(container)) {
- case IS_ARRAY: {
- HashTable *ht = Z_ARRVAL_P(container);
+ if (IS_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
+ HashTable *ht = Z_ARRVAL_P(container);
offset_again:
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
- break;
- case IS_LONG:
- hval = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ hval = zend_dval_to_lval(Z_DVAL_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_LONG:
+ hval = Z_LVAL_P(offset);
num_index_dim:
- zend_hash_index_del(ht, hval);
- break;
- case IS_STRING:
- if (IS_TMP_VAR != IS_CONST) {
- if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
- goto num_index_dim;
- }
- }
- if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
- } else {
- zend_hash_del(ht, Z_STR_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_STRING:
+ if (IS_TMP_VAR != IS_CONST) {
+ if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
+ goto num_index_dim;
}
- break;
- case IS_NULL:
- zend_hash_del(ht, STR_EMPTY_ALLOC());
- break;
- case IS_FALSE:
- hval = 0;
- goto num_index_dim;
- case IS_TRUE:
- hval = 1;
- goto num_index_dim;
- case IS_RESOURCE:
- hval = Z_RES_HANDLE_P(offset);
- goto num_index_dim;
- case IS_REFERENCE:
- offset = Z_REFVAL_P(offset);
- goto offset_again;
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in unset");
- break;
- }
- zval_ptr_dtor_nogc(free_op2.var);
- break;
+ }
+ if (ht == &EG(symbol_table).ht) {
+ zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ } else {
+ zend_hash_del(ht, Z_STR_P(offset));
+ }
+ break;
+ case IS_NULL:
+ zend_hash_del(ht, STR_EMPTY_ALLOC());
+ break;
+ case IS_FALSE:
+ hval = 0;
+ goto num_index_dim;
+ case IS_TRUE:
+ hval = 1;
+ goto num_index_dim;
+ case IS_RESOURCE:
+ hval = Z_RES_HANDLE_P(offset);
+ goto num_index_dim;
+ case IS_REFERENCE:
+ offset = Z_REFVAL_P(offset);
+ goto offset_again;
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in unset");
+ break;
}
- case IS_OBJECT:
- if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use object as array");
- }
-//??? if (IS_TMP_VAR == IS_CONST) {
-//??? zval_copy_ctor(offset);
-//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- break;
- case IS_STRING:
- zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
- ZEND_VM_CONTINUE(); /* bailed out before */
- default:
- zval_ptr_dtor_nogc(free_op2.var);
- break;
+ zval_ptr_dtor_nogc(free_op2.var);
+ } else if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot use object as array");
+ }
+//??? if (IS_TMP_VAR == IS_CONST) {
+//??? zval_copy_ctor(offset);
+//??? }
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2.var);
+ } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ ZEND_VM_CONTINUE(); /* bailed out before */
+ } else {
+ zval_ptr_dtor_nogc(free_op2.var);
}
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
CHECK_EXCEPTION();
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
ZVAL_DEREF(container);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_VAR != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_VAR != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
FREE_OP(free_op_data1);
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_VAR == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_VAR != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
if (RETURN_VALUE_USED(opline)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_VAR != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
ZVAL_NULL(retval);
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, IS_VAR, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
/* assign_obj has two opcodes! */
zend_free_op free_op2;
zval *property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, IS_VAR, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
} else {
zend_free_op free_op2, free_op_data1, free_op_data2;
object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
}
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- switch (Z_TYPE_P(container)) {
- case IS_ARRAY: {
- HashTable *ht = Z_ARRVAL_P(container);
+ if (IS_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
+ HashTable *ht = Z_ARRVAL_P(container);
offset_again:
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
- break;
- case IS_LONG:
- hval = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ hval = zend_dval_to_lval(Z_DVAL_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_LONG:
+ hval = Z_LVAL_P(offset);
num_index_dim:
- zend_hash_index_del(ht, hval);
- break;
- case IS_STRING:
- if (IS_VAR != IS_CONST) {
- if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
- goto num_index_dim;
- }
- }
- if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
- } else {
- zend_hash_del(ht, Z_STR_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_STRING:
+ if (IS_VAR != IS_CONST) {
+ if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
+ goto num_index_dim;
}
- break;
- case IS_NULL:
- zend_hash_del(ht, STR_EMPTY_ALLOC());
- break;
- case IS_FALSE:
- hval = 0;
- goto num_index_dim;
- case IS_TRUE:
- hval = 1;
- goto num_index_dim;
- case IS_RESOURCE:
- hval = Z_RES_HANDLE_P(offset);
- goto num_index_dim;
- case IS_REFERENCE:
- offset = Z_REFVAL_P(offset);
- goto offset_again;
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in unset");
- break;
- }
- zval_ptr_dtor_nogc(free_op2.var);
- break;
+ }
+ if (ht == &EG(symbol_table).ht) {
+ zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ } else {
+ zend_hash_del(ht, Z_STR_P(offset));
+ }
+ break;
+ case IS_NULL:
+ zend_hash_del(ht, STR_EMPTY_ALLOC());
+ break;
+ case IS_FALSE:
+ hval = 0;
+ goto num_index_dim;
+ case IS_TRUE:
+ hval = 1;
+ goto num_index_dim;
+ case IS_RESOURCE:
+ hval = Z_RES_HANDLE_P(offset);
+ goto num_index_dim;
+ case IS_REFERENCE:
+ offset = Z_REFVAL_P(offset);
+ goto offset_again;
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in unset");
+ break;
}
- case IS_OBJECT:
- if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use object as array");
- }
-//??? if (IS_VAR == IS_CONST) {
-//??? zval_copy_ctor(offset);
-//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- break;
- case IS_STRING:
- zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
- ZEND_VM_CONTINUE(); /* bailed out before */
- default:
- zval_ptr_dtor_nogc(free_op2.var);
- break;
+ zval_ptr_dtor_nogc(free_op2.var);
+ } else if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot use object as array");
+ }
+//??? if (IS_VAR == IS_CONST) {
+//??? zval_copy_ctor(offset);
+//??? }
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2.var);
+ } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ ZEND_VM_CONTINUE(); /* bailed out before */
+ } else {
+ zval_ptr_dtor_nogc(free_op2.var);
}
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
CHECK_EXCEPTION();
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
ZVAL_DEREF(container);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_VAR != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_VAR != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_VAR == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zval *property_name = NULL;
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_UNUSED == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, IS_VAR, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_UNUSED == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
} else {
zend_free_op free_op_data1, free_op_data2;
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_VAR != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_VAR == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_VAR == IS_VAR && !(free_op1.var != NULL)) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_VAR != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (RETURN_VALUE_USED(opline)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_VAR != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_VAR, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
if (IS_VAR == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, IS_VAR, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
/* assign_obj has two opcodes! */
zval *property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, IS_VAR, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
} else {
zend_free_op free_op_data1, free_op_data2;
object = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
}
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- switch (Z_TYPE_P(container)) {
- case IS_ARRAY: {
- HashTable *ht = Z_ARRVAL_P(container);
+ if (IS_VAR != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
+ HashTable *ht = Z_ARRVAL_P(container);
offset_again:
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
- break;
- case IS_LONG:
- hval = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ hval = zend_dval_to_lval(Z_DVAL_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_LONG:
+ hval = Z_LVAL_P(offset);
num_index_dim:
- zend_hash_index_del(ht, hval);
- break;
- case IS_STRING:
- if (IS_CV != IS_CONST) {
- if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
- goto num_index_dim;
- }
- }
- if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
- } else {
- zend_hash_del(ht, Z_STR_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_STRING:
+ if (IS_CV != IS_CONST) {
+ if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
+ goto num_index_dim;
}
- break;
- case IS_NULL:
- zend_hash_del(ht, STR_EMPTY_ALLOC());
- break;
- case IS_FALSE:
- hval = 0;
- goto num_index_dim;
- case IS_TRUE:
- hval = 1;
- goto num_index_dim;
- case IS_RESOURCE:
- hval = Z_RES_HANDLE_P(offset);
- goto num_index_dim;
- case IS_REFERENCE:
- offset = Z_REFVAL_P(offset);
- goto offset_again;
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in unset");
- break;
- }
+ }
+ if (ht == &EG(symbol_table).ht) {
+ zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ } else {
+ zend_hash_del(ht, Z_STR_P(offset));
+ }
+ break;
+ case IS_NULL:
+ zend_hash_del(ht, STR_EMPTY_ALLOC());
+ break;
+ case IS_FALSE:
+ hval = 0;
+ goto num_index_dim;
+ case IS_TRUE:
+ hval = 1;
+ goto num_index_dim;
+ case IS_RESOURCE:
+ hval = Z_RES_HANDLE_P(offset);
+ goto num_index_dim;
+ case IS_REFERENCE:
+ offset = Z_REFVAL_P(offset);
+ goto offset_again;
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in unset");
+ break;
+ }
- break;
+ } else if (IS_VAR == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot use object as array");
}
- case IS_OBJECT:
- if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use object as array");
- }
-//??? if (IS_CV == IS_CONST) {
-//??? zval_copy_ctor(offset);
-//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+//??? if (IS_CV == IS_CONST) {
+//??? zval_copy_ctor(offset);
+//??? }
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- break;
- case IS_STRING:
- zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
- ZEND_VM_CONTINUE(); /* bailed out before */
- default:
+ } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ ZEND_VM_CONTINUE(); /* bailed out before */
+ } else {
- break;
}
if (free_op1.var) {zval_ptr_dtor_nogc(free_op1.var);};
CHECK_EXCEPTION();
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
ZVAL_DEREF(container);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_VAR != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_VAR == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
obj = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
if (IS_UNUSED == IS_CONST ||
- UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
+ (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) {
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_UNUSED != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_UNUSED == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_UNUSED == IS_VAR && !0) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_UNUSED != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (RETURN_VALUE_USED(opline)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_UNUSED != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = opline->op2.zv;
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = opline->op2.zv;
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, IS_UNUSED, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
/* assign_obj has two opcodes! */
object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
}
offset = opline->op2.zv;
- switch (Z_TYPE_P(container)) {
- case IS_ARRAY: {
- HashTable *ht = Z_ARRVAL_P(container);
+ if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
+ HashTable *ht = Z_ARRVAL_P(container);
offset_again:
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
- break;
- case IS_LONG:
- hval = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ hval = zend_dval_to_lval(Z_DVAL_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_LONG:
+ hval = Z_LVAL_P(offset);
num_index_dim:
- zend_hash_index_del(ht, hval);
- break;
- case IS_STRING:
- if (IS_CONST != IS_CONST) {
- if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
- goto num_index_dim;
- }
- }
- if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
- } else {
- zend_hash_del(ht, Z_STR_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_STRING:
+ if (IS_CONST != IS_CONST) {
+ if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
+ goto num_index_dim;
}
- break;
- case IS_NULL:
- zend_hash_del(ht, STR_EMPTY_ALLOC());
- break;
- case IS_FALSE:
- hval = 0;
- goto num_index_dim;
- case IS_TRUE:
- hval = 1;
- goto num_index_dim;
- case IS_RESOURCE:
- hval = Z_RES_HANDLE_P(offset);
- goto num_index_dim;
- case IS_REFERENCE:
- offset = Z_REFVAL_P(offset);
- goto offset_again;
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in unset");
- break;
- }
+ }
+ if (ht == &EG(symbol_table).ht) {
+ zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ } else {
+ zend_hash_del(ht, Z_STR_P(offset));
+ }
+ break;
+ case IS_NULL:
+ zend_hash_del(ht, STR_EMPTY_ALLOC());
+ break;
+ case IS_FALSE:
+ hval = 0;
+ goto num_index_dim;
+ case IS_TRUE:
+ hval = 1;
+ goto num_index_dim;
+ case IS_RESOURCE:
+ hval = Z_RES_HANDLE_P(offset);
+ goto num_index_dim;
+ case IS_REFERENCE:
+ offset = Z_REFVAL_P(offset);
+ goto offset_again;
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in unset");
+ break;
+ }
- break;
+ } else if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot use object as array");
}
- case IS_OBJECT:
- if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use object as array");
- }
-//??? if (IS_CONST == IS_CONST) {
-//??? zval_copy_ctor(offset);
-//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+//??? if (IS_CONST == IS_CONST) {
+//??? zval_copy_ctor(offset);
+//??? }
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- break;
- case IS_STRING:
- zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
- ZEND_VM_CONTINUE(); /* bailed out before */
- default:
+ } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ ZEND_VM_CONTINUE(); /* bailed out before */
+ } else {
- break;
}
CHECK_EXCEPTION();
offset = opline->op2.zv;
ZVAL_DEREF(container);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = opline->op2.zv;
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_UNUSED != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = opline->op2.zv;
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_UNUSED != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
FREE_OP(free_op_data1);
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_UNUSED == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_UNUSED == IS_VAR && !0) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_UNUSED != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
if (RETURN_VALUE_USED(opline)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_UNUSED != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
ZVAL_NULL(retval);
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, IS_UNUSED, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
/* assign_obj has two opcodes! */
object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
}
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- switch (Z_TYPE_P(container)) {
- case IS_ARRAY: {
- HashTable *ht = Z_ARRVAL_P(container);
+ if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
+ HashTable *ht = Z_ARRVAL_P(container);
offset_again:
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
- break;
- case IS_LONG:
- hval = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ hval = zend_dval_to_lval(Z_DVAL_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_LONG:
+ hval = Z_LVAL_P(offset);
num_index_dim:
- zend_hash_index_del(ht, hval);
- break;
- case IS_STRING:
- if (IS_TMP_VAR != IS_CONST) {
- if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
- goto num_index_dim;
- }
- }
- if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
- } else {
- zend_hash_del(ht, Z_STR_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_STRING:
+ if (IS_TMP_VAR != IS_CONST) {
+ if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
+ goto num_index_dim;
}
- break;
- case IS_NULL:
- zend_hash_del(ht, STR_EMPTY_ALLOC());
- break;
- case IS_FALSE:
- hval = 0;
- goto num_index_dim;
- case IS_TRUE:
- hval = 1;
- goto num_index_dim;
- case IS_RESOURCE:
- hval = Z_RES_HANDLE_P(offset);
- goto num_index_dim;
- case IS_REFERENCE:
- offset = Z_REFVAL_P(offset);
- goto offset_again;
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in unset");
- break;
- }
- zval_ptr_dtor_nogc(free_op2.var);
- break;
+ }
+ if (ht == &EG(symbol_table).ht) {
+ zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ } else {
+ zend_hash_del(ht, Z_STR_P(offset));
+ }
+ break;
+ case IS_NULL:
+ zend_hash_del(ht, STR_EMPTY_ALLOC());
+ break;
+ case IS_FALSE:
+ hval = 0;
+ goto num_index_dim;
+ case IS_TRUE:
+ hval = 1;
+ goto num_index_dim;
+ case IS_RESOURCE:
+ hval = Z_RES_HANDLE_P(offset);
+ goto num_index_dim;
+ case IS_REFERENCE:
+ offset = Z_REFVAL_P(offset);
+ goto offset_again;
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in unset");
+ break;
}
- case IS_OBJECT:
- if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use object as array");
- }
-//??? if (IS_TMP_VAR == IS_CONST) {
-//??? zval_copy_ctor(offset);
-//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- break;
- case IS_STRING:
- zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
- ZEND_VM_CONTINUE(); /* bailed out before */
- default:
- zval_ptr_dtor_nogc(free_op2.var);
- break;
+ zval_ptr_dtor_nogc(free_op2.var);
+ } else if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot use object as array");
+ }
+//??? if (IS_TMP_VAR == IS_CONST) {
+//??? zval_copy_ctor(offset);
+//??? }
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2.var);
+ } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ ZEND_VM_CONTINUE(); /* bailed out before */
+ } else {
+ zval_ptr_dtor_nogc(free_op2.var);
}
CHECK_EXCEPTION();
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
ZVAL_DEREF(container);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_UNUSED != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_UNUSED != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
FREE_OP(free_op_data1);
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_UNUSED == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_UNUSED == IS_VAR && !0) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_UNUSED != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
if (RETURN_VALUE_USED(opline)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_UNUSED != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
ZVAL_NULL(retval);
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, IS_UNUSED, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
/* assign_obj has two opcodes! */
object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
}
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- switch (Z_TYPE_P(container)) {
- case IS_ARRAY: {
- HashTable *ht = Z_ARRVAL_P(container);
+ if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
+ HashTable *ht = Z_ARRVAL_P(container);
offset_again:
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
- break;
- case IS_LONG:
- hval = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ hval = zend_dval_to_lval(Z_DVAL_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_LONG:
+ hval = Z_LVAL_P(offset);
num_index_dim:
- zend_hash_index_del(ht, hval);
- break;
- case IS_STRING:
- if (IS_VAR != IS_CONST) {
- if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
- goto num_index_dim;
- }
- }
- if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
- } else {
- zend_hash_del(ht, Z_STR_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_STRING:
+ if (IS_VAR != IS_CONST) {
+ if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
+ goto num_index_dim;
}
- break;
- case IS_NULL:
- zend_hash_del(ht, STR_EMPTY_ALLOC());
- break;
- case IS_FALSE:
- hval = 0;
- goto num_index_dim;
- case IS_TRUE:
- hval = 1;
- goto num_index_dim;
- case IS_RESOURCE:
- hval = Z_RES_HANDLE_P(offset);
- goto num_index_dim;
- case IS_REFERENCE:
- offset = Z_REFVAL_P(offset);
- goto offset_again;
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in unset");
- break;
- }
- zval_ptr_dtor_nogc(free_op2.var);
- break;
+ }
+ if (ht == &EG(symbol_table).ht) {
+ zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ } else {
+ zend_hash_del(ht, Z_STR_P(offset));
+ }
+ break;
+ case IS_NULL:
+ zend_hash_del(ht, STR_EMPTY_ALLOC());
+ break;
+ case IS_FALSE:
+ hval = 0;
+ goto num_index_dim;
+ case IS_TRUE:
+ hval = 1;
+ goto num_index_dim;
+ case IS_RESOURCE:
+ hval = Z_RES_HANDLE_P(offset);
+ goto num_index_dim;
+ case IS_REFERENCE:
+ offset = Z_REFVAL_P(offset);
+ goto offset_again;
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in unset");
+ break;
}
- case IS_OBJECT:
- if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use object as array");
- }
-//??? if (IS_VAR == IS_CONST) {
-//??? zval_copy_ctor(offset);
-//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- break;
- case IS_STRING:
- zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
- ZEND_VM_CONTINUE(); /* bailed out before */
- default:
- zval_ptr_dtor_nogc(free_op2.var);
- break;
+ zval_ptr_dtor_nogc(free_op2.var);
+ } else if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot use object as array");
+ }
+//??? if (IS_VAR == IS_CONST) {
+//??? zval_copy_ctor(offset);
+//??? }
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2.var);
+ } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ ZEND_VM_CONTINUE(); /* bailed out before */
+ } else {
+ zval_ptr_dtor_nogc(free_op2.var);
}
CHECK_EXCEPTION();
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
ZVAL_DEREF(container);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_UNUSED != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_UNUSED != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_UNUSED == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_UNUSED == IS_VAR && !0) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_UNUSED != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_UNUSED == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_UNUSED == IS_VAR && !0) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_UNUSED != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (RETURN_VALUE_USED(opline)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_UNUSED != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_UNUSED, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
if (IS_UNUSED == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, IS_UNUSED, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
/* assign_obj has two opcodes! */
object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
}
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- switch (Z_TYPE_P(container)) {
- case IS_ARRAY: {
- HashTable *ht = Z_ARRVAL_P(container);
+ if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
+ HashTable *ht = Z_ARRVAL_P(container);
offset_again:
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
- break;
- case IS_LONG:
- hval = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ hval = zend_dval_to_lval(Z_DVAL_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_LONG:
+ hval = Z_LVAL_P(offset);
num_index_dim:
- zend_hash_index_del(ht, hval);
- break;
- case IS_STRING:
- if (IS_CV != IS_CONST) {
- if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
- goto num_index_dim;
- }
- }
- if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
- } else {
- zend_hash_del(ht, Z_STR_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_STRING:
+ if (IS_CV != IS_CONST) {
+ if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
+ goto num_index_dim;
}
- break;
- case IS_NULL:
- zend_hash_del(ht, STR_EMPTY_ALLOC());
- break;
- case IS_FALSE:
- hval = 0;
- goto num_index_dim;
- case IS_TRUE:
- hval = 1;
- goto num_index_dim;
- case IS_RESOURCE:
- hval = Z_RES_HANDLE_P(offset);
- goto num_index_dim;
- case IS_REFERENCE:
- offset = Z_REFVAL_P(offset);
- goto offset_again;
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in unset");
- break;
- }
+ }
+ if (ht == &EG(symbol_table).ht) {
+ zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ } else {
+ zend_hash_del(ht, Z_STR_P(offset));
+ }
+ break;
+ case IS_NULL:
+ zend_hash_del(ht, STR_EMPTY_ALLOC());
+ break;
+ case IS_FALSE:
+ hval = 0;
+ goto num_index_dim;
+ case IS_TRUE:
+ hval = 1;
+ goto num_index_dim;
+ case IS_RESOURCE:
+ hval = Z_RES_HANDLE_P(offset);
+ goto num_index_dim;
+ case IS_REFERENCE:
+ offset = Z_REFVAL_P(offset);
+ goto offset_again;
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in unset");
+ break;
+ }
- break;
+ } else if (IS_UNUSED == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot use object as array");
}
- case IS_OBJECT:
- if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use object as array");
- }
-//??? if (IS_CV == IS_CONST) {
-//??? zval_copy_ctor(offset);
-//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+//??? if (IS_CV == IS_CONST) {
+//??? zval_copy_ctor(offset);
+//??? }
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- break;
- case IS_STRING:
- zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
- ZEND_VM_CONTINUE(); /* bailed out before */
- default:
+ } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ ZEND_VM_CONTINUE(); /* bailed out before */
+ } else {
- break;
}
CHECK_EXCEPTION();
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
ZVAL_DEREF(container);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_UNUSED != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_UNUSED == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
obj = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_CONST ||
- UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
+ (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT))) {
if (UNEXPECTED(EG(exception) != NULL)) {
HANDLE_EXCEPTION();
}
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_CV != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_CV == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_CV == IS_VAR && !0) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_CV != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (RETURN_VALUE_USED(opline)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_CV != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
container = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
offset = opline->op2.zv;
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
offset = opline->op2.zv;
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, IS_CV, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
/* assign_obj has two opcodes! */
zval *property_name = opline->op2.zv;
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, IS_CV, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
} else {
zend_free_op free_op_data1, free_op_data2;
object = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
}
offset = opline->op2.zv;
- switch (Z_TYPE_P(container)) {
- case IS_ARRAY: {
- HashTable *ht = Z_ARRVAL_P(container);
+ if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
+ HashTable *ht = Z_ARRVAL_P(container);
offset_again:
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
- break;
- case IS_LONG:
- hval = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ hval = zend_dval_to_lval(Z_DVAL_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_LONG:
+ hval = Z_LVAL_P(offset);
num_index_dim:
- zend_hash_index_del(ht, hval);
- break;
- case IS_STRING:
- if (IS_CONST != IS_CONST) {
- if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
- goto num_index_dim;
- }
- }
- if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
- } else {
- zend_hash_del(ht, Z_STR_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_STRING:
+ if (IS_CONST != IS_CONST) {
+ if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
+ goto num_index_dim;
}
- break;
- case IS_NULL:
- zend_hash_del(ht, STR_EMPTY_ALLOC());
- break;
- case IS_FALSE:
- hval = 0;
- goto num_index_dim;
- case IS_TRUE:
- hval = 1;
- goto num_index_dim;
- case IS_RESOURCE:
- hval = Z_RES_HANDLE_P(offset);
- goto num_index_dim;
- case IS_REFERENCE:
- offset = Z_REFVAL_P(offset);
- goto offset_again;
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in unset");
- break;
- }
+ }
+ if (ht == &EG(symbol_table).ht) {
+ zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ } else {
+ zend_hash_del(ht, Z_STR_P(offset));
+ }
+ break;
+ case IS_NULL:
+ zend_hash_del(ht, STR_EMPTY_ALLOC());
+ break;
+ case IS_FALSE:
+ hval = 0;
+ goto num_index_dim;
+ case IS_TRUE:
+ hval = 1;
+ goto num_index_dim;
+ case IS_RESOURCE:
+ hval = Z_RES_HANDLE_P(offset);
+ goto num_index_dim;
+ case IS_REFERENCE:
+ offset = Z_REFVAL_P(offset);
+ goto offset_again;
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in unset");
+ break;
+ }
- break;
+ } else if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot use object as array");
}
- case IS_OBJECT:
- if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use object as array");
- }
-//??? if (IS_CONST == IS_CONST) {
-//??? zval_copy_ctor(offset);
-//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+//??? if (IS_CONST == IS_CONST) {
+//??? zval_copy_ctor(offset);
+//??? }
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- break;
- case IS_STRING:
- zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
- ZEND_VM_CONTINUE(); /* bailed out before */
- default:
+ } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ ZEND_VM_CONTINUE(); /* bailed out before */
+ } else {
- break;
}
CHECK_EXCEPTION();
offset = opline->op2.zv;
ZVAL_DEREF(container);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
offset = opline->op2.zv;
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_CV != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
offset = opline->op2.zv;
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CONST == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_CV != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
FREE_OP(free_op_data1);
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_CV == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_CV == IS_VAR && !0) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_CV != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
if (RETURN_VALUE_USED(opline)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_CV != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
ZVAL_NULL(retval);
container = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, IS_CV, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
/* assign_obj has two opcodes! */
zend_free_op free_op2;
zval *property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, IS_CV, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
} else {
zend_free_op free_op2, free_op_data1, free_op_data2;
object = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
}
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- switch (Z_TYPE_P(container)) {
- case IS_ARRAY: {
- HashTable *ht = Z_ARRVAL_P(container);
+ if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
+ HashTable *ht = Z_ARRVAL_P(container);
offset_again:
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
- break;
- case IS_LONG:
- hval = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ hval = zend_dval_to_lval(Z_DVAL_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_LONG:
+ hval = Z_LVAL_P(offset);
num_index_dim:
- zend_hash_index_del(ht, hval);
- break;
- case IS_STRING:
- if (IS_TMP_VAR != IS_CONST) {
- if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
- goto num_index_dim;
- }
- }
- if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
- } else {
- zend_hash_del(ht, Z_STR_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_STRING:
+ if (IS_TMP_VAR != IS_CONST) {
+ if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
+ goto num_index_dim;
}
- break;
- case IS_NULL:
- zend_hash_del(ht, STR_EMPTY_ALLOC());
- break;
- case IS_FALSE:
- hval = 0;
- goto num_index_dim;
- case IS_TRUE:
- hval = 1;
- goto num_index_dim;
- case IS_RESOURCE:
- hval = Z_RES_HANDLE_P(offset);
- goto num_index_dim;
- case IS_REFERENCE:
- offset = Z_REFVAL_P(offset);
- goto offset_again;
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in unset");
- break;
- }
- zval_ptr_dtor_nogc(free_op2.var);
- break;
+ }
+ if (ht == &EG(symbol_table).ht) {
+ zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ } else {
+ zend_hash_del(ht, Z_STR_P(offset));
+ }
+ break;
+ case IS_NULL:
+ zend_hash_del(ht, STR_EMPTY_ALLOC());
+ break;
+ case IS_FALSE:
+ hval = 0;
+ goto num_index_dim;
+ case IS_TRUE:
+ hval = 1;
+ goto num_index_dim;
+ case IS_RESOURCE:
+ hval = Z_RES_HANDLE_P(offset);
+ goto num_index_dim;
+ case IS_REFERENCE:
+ offset = Z_REFVAL_P(offset);
+ goto offset_again;
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in unset");
+ break;
}
- case IS_OBJECT:
- if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use object as array");
- }
-//??? if (IS_TMP_VAR == IS_CONST) {
-//??? zval_copy_ctor(offset);
-//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- break;
- case IS_STRING:
- zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
- ZEND_VM_CONTINUE(); /* bailed out before */
- default:
- zval_ptr_dtor_nogc(free_op2.var);
- break;
+ zval_ptr_dtor_nogc(free_op2.var);
+ } else if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot use object as array");
+ }
+//??? if (IS_TMP_VAR == IS_CONST) {
+//??? zval_copy_ctor(offset);
+//??? }
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2.var);
+ } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ ZEND_VM_CONTINUE(); /* bailed out before */
+ } else {
+ zval_ptr_dtor_nogc(free_op2.var);
}
CHECK_EXCEPTION();
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
ZVAL_DEREF(container);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_CV != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_TMP_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_CV != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
FREE_OP(free_op_data1);
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_CV == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_CV == IS_VAR && !0) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_CV != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
if (RETURN_VALUE_USED(opline)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_CV != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
zval_ptr_dtor_nogc(free_op2.var);
ZVAL_NULL(retval);
container = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, IS_CV, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
/* assign_obj has two opcodes! */
zend_free_op free_op2;
zval *property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, IS_CV, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
zval_ptr_dtor_nogc(free_op2.var);
} else {
zend_free_op free_op2, free_op_data1, free_op_data2;
object = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
}
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- switch (Z_TYPE_P(container)) {
- case IS_ARRAY: {
- HashTable *ht = Z_ARRVAL_P(container);
+ if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
+ HashTable *ht = Z_ARRVAL_P(container);
offset_again:
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
- break;
- case IS_LONG:
- hval = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ hval = zend_dval_to_lval(Z_DVAL_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_LONG:
+ hval = Z_LVAL_P(offset);
num_index_dim:
- zend_hash_index_del(ht, hval);
- break;
- case IS_STRING:
- if (IS_VAR != IS_CONST) {
- if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
- goto num_index_dim;
- }
- }
- if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
- } else {
- zend_hash_del(ht, Z_STR_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_STRING:
+ if (IS_VAR != IS_CONST) {
+ if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
+ goto num_index_dim;
}
- break;
- case IS_NULL:
- zend_hash_del(ht, STR_EMPTY_ALLOC());
- break;
- case IS_FALSE:
- hval = 0;
- goto num_index_dim;
- case IS_TRUE:
- hval = 1;
- goto num_index_dim;
- case IS_RESOURCE:
- hval = Z_RES_HANDLE_P(offset);
- goto num_index_dim;
- case IS_REFERENCE:
- offset = Z_REFVAL_P(offset);
- goto offset_again;
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in unset");
- break;
- }
- zval_ptr_dtor_nogc(free_op2.var);
- break;
+ }
+ if (ht == &EG(symbol_table).ht) {
+ zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ } else {
+ zend_hash_del(ht, Z_STR_P(offset));
+ }
+ break;
+ case IS_NULL:
+ zend_hash_del(ht, STR_EMPTY_ALLOC());
+ break;
+ case IS_FALSE:
+ hval = 0;
+ goto num_index_dim;
+ case IS_TRUE:
+ hval = 1;
+ goto num_index_dim;
+ case IS_RESOURCE:
+ hval = Z_RES_HANDLE_P(offset);
+ goto num_index_dim;
+ case IS_REFERENCE:
+ offset = Z_REFVAL_P(offset);
+ goto offset_again;
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in unset");
+ break;
}
- case IS_OBJECT:
- if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use object as array");
- }
-//??? if (IS_VAR == IS_CONST) {
-//??? zval_copy_ctor(offset);
-//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- zval_ptr_dtor_nogc(free_op2.var);
- break;
- case IS_STRING:
- zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
- ZEND_VM_CONTINUE(); /* bailed out before */
- default:
- zval_ptr_dtor_nogc(free_op2.var);
- break;
+ zval_ptr_dtor_nogc(free_op2.var);
+ } else if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot use object as array");
+ }
+//??? if (IS_VAR == IS_CONST) {
+//??? zval_copy_ctor(offset);
+//??? }
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+ zval_ptr_dtor_nogc(free_op2.var);
+ } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ ZEND_VM_CONTINUE(); /* bailed out before */
+ } else {
+ zval_ptr_dtor_nogc(free_op2.var);
}
CHECK_EXCEPTION();
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
ZVAL_DEREF(container);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_CV != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_VAR == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_CV != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_CV == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_CV == IS_VAR && !0) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zval *property_name = NULL;
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_UNUSED == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, IS_CV, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_UNUSED == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
} else {
zend_free_op free_op_data1, free_op_data2;
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- object = make_real_object(object TSRMLS_CC);
+ if (IS_CV != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC);
+ }
value = get_zval_ptr((opline+1)->op1_type, &(opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op_data1);
container = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var TSRMLS_CC);
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
- } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ } else if (IS_CV == IS_UNUSED || UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
if (IS_CV == IS_VAR && !0) {
Z_ADDREF_P(container); /* undo the effect of get_obj_zval_ptr_ptr() */
}
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_CV != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
if (RETURN_VALUE_USED(opline)) {
zend_error_noreturn(E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets");
}
- object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ if (IS_CV != IS_UNUSED) {
+ object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
+ }
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
ZVAL_NULL(retval);
container = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
zend_error(E_NOTICE, "Trying to get property of non-object");
ZVAL_NULL(EX_VAR(opline->result.var));
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, (opline->extended_value & ZEND_FETCH_MAKE_REF) != 0 TSRMLS_CC);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_RW, 0 TSRMLS_CC);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
+ if ((IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) ||
UNEXPECTED(Z_OBJ_HT_P(container)->read_property == NULL)) {
ZVAL_NULL(EX_VAR(opline->result.var));
} else {
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_W, 0 TSRMLS_CC);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
}
- zend_fetch_property_address(EX_VAR(opline->result.var), container, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
+ zend_fetch_property_address(EX_VAR(opline->result.var), container, IS_CV, property, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property)) : NULL), BP_VAR_UNSET, 0 TSRMLS_CC);
if (IS_CV == IS_VAR && READY_TO_DESTROY(free_op1.var)) {
EXTRACT_ZVAL_PTR(EX_VAR(opline->result.var));
if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object, IS_CV, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_OBJ, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
/* assign_obj has two opcodes! */
zval *property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
+ zend_assign_to_object(RETURN_VALUE_USED(opline)?EX_VAR(opline->result.var):NULL, object_ptr, IS_CV, property_name, (opline+1)->op1_type, &(opline+1)->op1, execute_data, ZEND_ASSIGN_DIM, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(property_name)) : NULL) TSRMLS_CC);
} else {
zend_free_op free_op_data1, free_op_data2;
object = _get_zval_ptr_cv_deref_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
- if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+ if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
uint32_t nesting = 1;
if (UNEXPECTED(EG(exception) != NULL)) {
}
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- switch (Z_TYPE_P(container)) {
- case IS_ARRAY: {
- HashTable *ht = Z_ARRVAL_P(container);
+ if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) {
+ HashTable *ht = Z_ARRVAL_P(container);
offset_again:
- switch (Z_TYPE_P(offset)) {
- case IS_DOUBLE:
- hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
- break;
- case IS_LONG:
- hval = Z_LVAL_P(offset);
+ switch (Z_TYPE_P(offset)) {
+ case IS_DOUBLE:
+ hval = zend_dval_to_lval(Z_DVAL_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_LONG:
+ hval = Z_LVAL_P(offset);
num_index_dim:
- zend_hash_index_del(ht, hval);
- break;
- case IS_STRING:
- if (IS_CV != IS_CONST) {
- if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
- goto num_index_dim;
- }
- }
- if (ht == &EG(symbol_table).ht) {
- zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
- } else {
- zend_hash_del(ht, Z_STR_P(offset));
+ zend_hash_index_del(ht, hval);
+ break;
+ case IS_STRING:
+ if (IS_CV != IS_CONST) {
+ if (ZEND_HANDLE_NUMERIC(Z_STR_P(offset), hval)) {
+ goto num_index_dim;
}
- break;
- case IS_NULL:
- zend_hash_del(ht, STR_EMPTY_ALLOC());
- break;
- case IS_FALSE:
- hval = 0;
- goto num_index_dim;
- case IS_TRUE:
- hval = 1;
- goto num_index_dim;
- case IS_RESOURCE:
- hval = Z_RES_HANDLE_P(offset);
- goto num_index_dim;
- case IS_REFERENCE:
- offset = Z_REFVAL_P(offset);
- goto offset_again;
- break;
- default:
- zend_error(E_WARNING, "Illegal offset type in unset");
- break;
- }
+ }
+ if (ht == &EG(symbol_table).ht) {
+ zend_delete_global_variable(Z_STR_P(offset) TSRMLS_CC);
+ } else {
+ zend_hash_del(ht, Z_STR_P(offset));
+ }
+ break;
+ case IS_NULL:
+ zend_hash_del(ht, STR_EMPTY_ALLOC());
+ break;
+ case IS_FALSE:
+ hval = 0;
+ goto num_index_dim;
+ case IS_TRUE:
+ hval = 1;
+ goto num_index_dim;
+ case IS_RESOURCE:
+ hval = Z_RES_HANDLE_P(offset);
+ goto num_index_dim;
+ case IS_REFERENCE:
+ offset = Z_REFVAL_P(offset);
+ goto offset_again;
+ break;
+ default:
+ zend_error(E_WARNING, "Illegal offset type in unset");
+ break;
+ }
- break;
+ } else if (IS_CV == IS_UNUSED || EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
+ zend_error_noreturn(E_ERROR, "Cannot use object as array");
}
- case IS_OBJECT:
- if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) {
- zend_error_noreturn(E_ERROR, "Cannot use object as array");
- }
-//??? if (IS_CV == IS_CONST) {
-//??? zval_copy_ctor(offset);
-//??? }
- Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
+//??? if (IS_CV == IS_CONST) {
+//??? zval_copy_ctor(offset);
+//??? }
+ Z_OBJ_HT_P(container)->unset_dimension(container, offset TSRMLS_CC);
- break;
- case IS_STRING:
- zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
- ZEND_VM_CONTINUE(); /* bailed out before */
- default:
+ } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+ zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
+ ZEND_VM_CONTINUE(); /* bailed out before */
+ } else {
- break;
}
CHECK_EXCEPTION();
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
ZVAL_DEREF(container);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->unset_property) {
Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_ARRAY) {
+ if (IS_CV != IS_UNUSED && Z_TYPE_P(container) == IS_ARRAY) {
HashTable *ht = Z_ARRVAL_P(container);
zval *value;
zend_string *str;
} else /* if (opline->extended_value & ZEND_ISEMPTY) */ {
result = (value == NULL || !i_zend_is_true(value TSRMLS_CC));
}
- } else if (Z_TYPE_P(container) == IS_OBJECT) {
+ } else if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_dimension) {
result = Z_OBJ_HT_P(container)->has_dimension(container, offset, (opline->extended_value & ZEND_ISSET) == 0 TSRMLS_CC);
} else {
container = _get_zval_ptr_cv_deref_BP_VAR_IS(execute_data, opline->op1.var TSRMLS_CC);
offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
- if (Z_TYPE_P(container) == IS_OBJECT) {
+ if (IS_CV == IS_UNUSED || Z_TYPE_P(container) == IS_OBJECT) {
if (Z_OBJ_HT_P(container)->has_property) {
result = Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISSET) == 0, ((IS_CV == IS_CONST) ? (EX(run_time_cache) + Z_CACHE_SLOT_P(offset)) : NULL) TSRMLS_CC);
} else {