From 53d20140fbe4a5fa4339a7429280b4a964f5791d Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 2 Apr 2015 03:56:42 +0300 Subject: [PATCH] Fixed performance degradation introduced with lateast EnfineException related changes. Restore original errors order in executor. --- Zend/zend_API.c | 2 +- Zend/zend_execute_API.c | 66 +++-- Zend/zend_operators.c | 2 +- Zend/zend_vm_def.h | 75 +++-- Zend/zend_vm_execute.h | 637 +++++++++++++++++++++++++--------------- 5 files changed, 483 insertions(+), 299 deletions(-) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 6744ea0a76..bc7c0ffc46 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -1280,7 +1280,7 @@ ZEND_API void object_properties_load(zend_object *object, HashTable *properties) * calling zend_merge_properties(). */ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC) /* {{{ */ { - if (class_type->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) { + if (UNEXPECTED(class_type->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) { if (class_type->ce_flags & ZEND_ACC_INTERFACE) { zend_error(E_EXCEPTION | E_ERROR, "Cannot instantiate interface %s", class_type->name->val); } else if (class_type->ce_flags & ZEND_ACC_TRAIT) { diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 995850ff62..f6090685d9 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -1301,54 +1301,59 @@ void zend_unset_timeout(void) /* {{{ */ zend_class_entry *zend_fetch_class(zend_string *class_name, int fetch_type) /* {{{ */ { zend_class_entry *ce; - int use_autoload = (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) == 0; - int silent = (fetch_type & ZEND_FETCH_CLASS_SILENT) != 0; - int error_type = (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) ? - (E_EXCEPTION | E_ERROR) : E_ERROR; - - fetch_type &= ZEND_FETCH_CLASS_MASK; + int fetch_sub_type = fetch_type & ZEND_FETCH_CLASS_MASK; check_fetch_type: - switch (fetch_type) { + switch (fetch_sub_type) { case ZEND_FETCH_CLASS_SELF: if (UNEXPECTED(!EG(scope))) { + int error_type = (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) ? + (E_EXCEPTION | E_ERROR) : E_ERROR; zend_error(error_type, "Cannot access self:: when no class scope is active"); } return EG(scope); case ZEND_FETCH_CLASS_PARENT: if (UNEXPECTED(!EG(scope))) { + int error_type = (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) ? + (E_EXCEPTION | E_ERROR) : E_ERROR; zend_error(error_type, "Cannot access parent:: when no class scope is active"); return NULL; } if (UNEXPECTED(!EG(scope)->parent)) { + int error_type = (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) ? + (E_EXCEPTION | E_ERROR) : E_ERROR; zend_error(error_type, "Cannot access parent:: when current class scope has no parent"); } return EG(scope)->parent; case ZEND_FETCH_CLASS_STATIC: if (UNEXPECTED(!EG(current_execute_data)) || UNEXPECTED(!EG(current_execute_data)->called_scope)) { + int error_type = (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) ? + (E_EXCEPTION | E_ERROR) : E_ERROR; zend_error(error_type, "Cannot access static:: when no class scope is active"); return NULL; } return EG(current_execute_data)->called_scope; case ZEND_FETCH_CLASS_AUTO: { - fetch_type = zend_get_class_fetch_type(class_name); - if (fetch_type!=ZEND_FETCH_CLASS_DEFAULT) { + fetch_sub_type = zend_get_class_fetch_type(class_name); + if (UNEXPECTED(fetch_sub_type != ZEND_FETCH_CLASS_DEFAULT)) { goto check_fetch_type; } } break; } - if ((ce = zend_lookup_class_ex(class_name, NULL, use_autoload)) == NULL) { - if (use_autoload) { - if (!silent && !EG(exception)) { - if (fetch_type == ZEND_FETCH_CLASS_INTERFACE) { - zend_error(error_type, "Interface '%s' not found", class_name->val); - } else if (fetch_type == ZEND_FETCH_CLASS_TRAIT) { - zend_error(error_type, "Trait '%s' not found", class_name->val); - } else { - zend_error(error_type, "Class '%s' not found", class_name->val); - } + if (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) { + return zend_lookup_class_ex(class_name, NULL, 0); + } else if ((ce = zend_lookup_class_ex(class_name, NULL, 1)) == NULL) { + if (!(fetch_type & ZEND_FETCH_CLASS_SILENT) && !EG(exception)) { + int error_type = (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) ? + (E_EXCEPTION | E_ERROR) : E_ERROR; + if (fetch_sub_type == ZEND_FETCH_CLASS_INTERFACE) { + zend_error(error_type, "Interface '%s' not found", class_name->val); + } else if (fetch_sub_type == ZEND_FETCH_CLASS_TRAIT) { + zend_error(error_type, "Trait '%s' not found", class_name->val); + } else { + zend_error(error_type, "Class '%s' not found", class_name->val); } } return NULL; @@ -1360,20 +1365,19 @@ check_fetch_type: zend_class_entry *zend_fetch_class_by_name(zend_string *class_name, const zval *key, int fetch_type) /* {{{ */ { zend_class_entry *ce; - int use_autoload = (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) == 0; - if ((ce = zend_lookup_class_ex(class_name, key, use_autoload)) == NULL) { - if (use_autoload) { + if (fetch_type & ZEND_FETCH_CLASS_NO_AUTOLOAD) { + return zend_lookup_class_ex(class_name, key, 0); + } else if ((ce = zend_lookup_class_ex(class_name, key, 1)) == NULL) { + if ((fetch_type & ZEND_FETCH_CLASS_SILENT) == 0 && !EG(exception)) { int error_type = (fetch_type & ZEND_FETCH_CLASS_EXCEPTION) ? - (E_EXCEPTION | E_ERROR) : E_ERROR; - if ((fetch_type & ZEND_FETCH_CLASS_SILENT) == 0 && !EG(exception)) { - if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_INTERFACE) { - zend_error(error_type, "Interface '%s' not found", class_name->val); - } else if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_TRAIT) { - zend_error(error_type, "Trait '%s' not found", class_name->val); - } else { - zend_error(error_type, "Class '%s' not found", class_name->val); - } + (E_EXCEPTION | E_ERROR) : E_ERROR; + if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_INTERFACE) { + zend_error(error_type, "Interface '%s' not found", class_name->val); + } else if ((fetch_type & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_TRAIT) { + zend_error(error_type, "Trait '%s' not found", class_name->val); + } else { + zend_error(error_type, "Class '%s' not found", class_name->val); } } return NULL; diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 3cfa0081a7..8ded1f2de9 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -1544,7 +1544,7 @@ ZEND_API int ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2) / size_t result_len = op1_len + op2_len; zend_string *result_str; - if (op1_len > SIZE_MAX - op2_len) { + if (UNEXPECTED(op1_len > SIZE_MAX - op2_len)) { zend_error(E_EXCEPTION | E_ERROR, "String size overflow"); ZVAL_FALSE(result); return FAILURE; diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 57e77375b3..bd0ba8dd78 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -631,13 +631,16 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR| SAVE_OPLINE(); object = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW); - property = GET_OP2_ZVAL_PTR(BP_VAR_R); + if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); - FREE_OP2(); + FREE_UNFETCHED_OP2(); HANDLE_EXCEPTION(); } + + property = GET_OP2_ZVAL_PTR(BP_VAR_R); + if (OP1_TYPE == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); @@ -1057,19 +1060,19 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|C zend_free_op free_op1, free_op2; zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW); - property = GET_OP2_ZVAL_PTR(BP_VAR_R); - retval = EX_VAR(opline->result.var); if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - FREE_OP2(); + FREE_UNFETCHED_OP2(); HANDLE_EXCEPTION(); } + + property = GET_OP2_ZVAL_PTR(BP_VAR_R); + if (OP1_TYPE == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); FREE_OP2(); @@ -1083,7 +1086,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|C if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } break; } @@ -1099,7 +1102,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|C incdec_op(zptr); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, zptr); + ZVAL_COPY(EX_VAR(opline->result.var), zptr); } } else { zval rv; @@ -1124,7 +1127,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|C SEPARATE_ZVAL_NOREF(z); incdec_op(z); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, z); + ZVAL_COPY(EX_VAR(opline->result.var), z); } Z_OBJ_HT(obj)->write_property(&obj, property, z, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL)); OBJ_RELEASE(Z_OBJ(obj)); @@ -1132,7 +1135,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|C } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } @@ -1160,19 +1163,19 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR| zend_free_op free_op1, free_op2; zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_RW); - property = GET_OP2_ZVAL_PTR(BP_VAR_R); - retval = EX_VAR(opline->result.var); if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - FREE_OP2(); + FREE_UNFETCHED_OP2(); HANDLE_EXCEPTION(); } + + property = GET_OP2_ZVAL_PTR(BP_VAR_R); + if (OP1_TYPE == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); FREE_OP2(); @@ -1185,7 +1188,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR| ZVAL_DEREF(object); if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); break; } } @@ -1196,7 +1199,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR| && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) { ZVAL_DEREF(zptr); - ZVAL_COPY_VALUE(retval, zptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), zptr); zval_opt_copy_ctor(zptr); incdec_op(zptr); } else { @@ -1217,7 +1220,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR| } ZVAL_COPY_VALUE(z, value); } - ZVAL_DUP(retval, z); + ZVAL_DUP(EX_VAR(opline->result.var), z); ZVAL_DUP(&z_copy, z); incdec_op(&z_copy); if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z); @@ -1227,7 +1230,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR| zval_ptr_dtor(z); } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } while (0); @@ -1797,13 +1800,15 @@ ZEND_VM_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMP|VAR|UNUSED|CV, CONST|TMPVAR|CV) SAVE_OPLINE(); container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R); - offset = GET_OP2_ZVAL_PTR(BP_VAR_R); if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - FREE_OP2(); + FREE_UNFETCHED_OP2(); HANDLE_EXCEPTION(); } + + offset = GET_OP2_ZVAL_PTR(BP_VAR_R); + if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -1933,13 +1938,15 @@ ZEND_VM_HANDLER(91, ZEND_FETCH_OBJ_IS, CONST|TMPVAR|UNUSED|CV, CONST|TMPVAR|CV) SAVE_OPLINE(); container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_IS); - offset = GET_OP2_ZVAL_PTR(BP_VAR_R); if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - FREE_OP2(); + FREE_UNFETCHED_OP2(); HANDLE_EXCEPTION(); } + + offset = GET_OP2_ZVAL_PTR(BP_VAR_R); + if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -2046,13 +2053,15 @@ ZEND_VM_HANDLER(97, ZEND_FETCH_OBJ_UNSET, VAR|UNUSED|CV, CONST|TMPVAR|CV) SAVE_OPLINE(); container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET); - property = GET_OP2_ZVAL_PTR(BP_VAR_R); if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - FREE_OP2(); + FREE_UNFETCHED_OP2(); HANDLE_EXCEPTION(); } + + property = GET_OP2_ZVAL_PTR(BP_VAR_R); + if (OP1_TYPE == IS_VAR && UNEXPECTED(container == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); FREE_OP2(); @@ -2114,13 +2123,15 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|CV, CONST|TMPVAR|CV) SAVE_OPLINE(); object = GET_OP1_OBJ_ZVAL_PTR_PTR_UNDEF(BP_VAR_W); - property_name = GET_OP2_ZVAL_PTR(BP_VAR_R); if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - FREE_OP2(); + FREE_UNFETCHED_OP2(); HANDLE_EXCEPTION(); } + + property_name = GET_OP2_ZVAL_PTR(BP_VAR_R); + if (OP1_TYPE == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); FREE_OP2(); @@ -6260,13 +6271,15 @@ ZEND_VM_HANDLER(115, ZEND_ISSET_ISEMPTY_DIM_OBJ, CONST|TMPVAR|UNUSED|CV, CONST|T SAVE_OPLINE(); container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_IS); - offset = GET_OP2_ZVAL_PTR(BP_VAR_R); if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - FREE_OP2(); + FREE_UNFETCHED_OP2(); HANDLE_EXCEPTION(); } + + offset = GET_OP2_ZVAL_PTR(BP_VAR_R); + ZEND_VM_C_LABEL(isset_dim_obj_again): if (OP1_TYPE != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { HashTable *ht = Z_ARRVAL_P(container); @@ -6382,13 +6395,15 @@ ZEND_VM_HANDLER(148, ZEND_ISSET_ISEMPTY_PROP_OBJ, CONST|TMPVAR|UNUSED|CV, CONST| SAVE_OPLINE(); container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_IS); - offset = GET_OP2_ZVAL_PTR(BP_VAR_R); if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - FREE_OP2(); + FREE_UNFETCHED_OP2(); HANDLE_EXCEPTION(); } + + offset = GET_OP2_ZVAL_PTR(BP_VAR_R); + if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index a99e13456a..fde4caed16 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4747,13 +4747,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_H SAVE_OPLINE(); container = EX_CONSTANT(opline->op1); - offset = EX_CONSTANT(opline->op2); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + if (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -4817,13 +4819,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST_ SAVE_OPLINE(); container = EX_CONSTANT(opline->op1); - offset = EX_CONSTANT(opline->op2); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + if (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -5658,13 +5662,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON SAVE_OPLINE(); container = EX_CONSTANT(opline->op1); - offset = EX_CONSTANT(opline->op2); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + isset_dim_obj_again: if (IS_CONST != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { HashTable *ht = Z_ARRVAL_P(container); @@ -5779,13 +5785,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CO SAVE_OPLINE(); container = EX_CONSTANT(opline->op1); - offset = EX_CONSTANT(opline->op2); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + if (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -8221,13 +8229,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HAND SAVE_OPLINE(); container = EX_CONSTANT(opline->op1); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -8291,13 +8301,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CV_HAN SAVE_OPLINE(); container = EX_CONSTANT(opline->op1); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -8866,13 +8878,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON SAVE_OPLINE(); container = EX_CONSTANT(opline->op1); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + isset_dim_obj_again: if (IS_CONST != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { HashTable *ht = Z_ARRVAL_P(container); @@ -8987,13 +9001,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CO SAVE_OPLINE(); container = EX_CONSTANT(opline->op1); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -9789,13 +9805,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR_ SAVE_OPLINE(); container = EX_CONSTANT(opline->op1); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -9860,13 +9878,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR SAVE_OPLINE(); container = EX_CONSTANT(opline->op1); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -10386,13 +10406,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CON SAVE_OPLINE(); container = EX_CONSTANT(opline->op1); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + isset_dim_obj_again: if (IS_CONST != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { HashTable *ht = Z_ARRVAL_P(container); @@ -10508,13 +10530,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CO SAVE_OPLINE(); container = EX_CONSTANT(opline->op1); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CONST == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_CONST != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -11378,13 +11402,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CONST_HAN SAVE_OPLINE(); container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1); - offset = EX_CONSTANT(opline->op2); if (IS_TMP_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + if (IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -12577,13 +12603,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CV_HANDLE SAVE_OPLINE(); container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_TMP_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -13054,13 +13082,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_TMPVAR_HA SAVE_OPLINE(); container = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_TMP_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_TMP_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -14839,13 +14869,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP SAVE_OPLINE(); object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property = EX_CONSTANT(opline->op2); + if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } + + property = EX_CONSTANT(opline->op2); + if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); @@ -15263,19 +15296,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE zend_free_op free_op1; zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property = EX_CONSTANT(opline->op2); - retval = EX_VAR(opline->result.var); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = EX_CONSTANT(opline->op2); + if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -15289,7 +15322,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } break; } @@ -15305,7 +15338,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE incdec_op(zptr); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, zptr); + ZVAL_COPY(EX_VAR(opline->result.var), zptr); } } else { zval rv; @@ -15330,7 +15363,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE SEPARATE_ZVAL_NOREF(z); incdec_op(z); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, z); + ZVAL_COPY(EX_VAR(opline->result.var), z); } Z_OBJ_HT(obj)->write_property(&obj, property, z, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL)); OBJ_RELEASE(Z_OBJ(obj)); @@ -15338,7 +15371,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } @@ -15365,19 +15398,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zend_free_op free_op1; zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property = EX_CONSTANT(opline->op2); - retval = EX_VAR(opline->result.var); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = EX_CONSTANT(opline->op2); + if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -15390,7 +15423,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP ZVAL_DEREF(object); if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); break; } } @@ -15401,7 +15434,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) { ZVAL_DEREF(zptr); - ZVAL_COPY_VALUE(retval, zptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), zptr); zval_opt_copy_ctor(zptr); incdec_op(zptr); } else { @@ -15422,7 +15455,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP } ZVAL_COPY_VALUE(z, value); } - ZVAL_DUP(retval, z); + ZVAL_DUP(EX_VAR(opline->result.var), z); ZVAL_DUP(&z_copy, z); incdec_op(&z_copy); if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z); @@ -15432,7 +15465,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zval_ptr_dtor(z); } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } while (0); @@ -15579,13 +15612,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HAN SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); - offset = EX_CONSTANT(opline->op2); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -15756,13 +15791,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CONST SAVE_OPLINE(); container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property = EX_CONSTANT(opline->op2); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = EX_CONSTANT(opline->op2); + if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); @@ -15788,13 +15825,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CONST_HAND SAVE_OPLINE(); object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property_name = EX_CONSTANT(opline->op2); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property_name = EX_CONSTANT(opline->op2); + if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); @@ -18041,13 +18080,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP SAVE_OPLINE(); object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); @@ -18465,19 +18507,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE zend_free_op free_op1; zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); - retval = EX_VAR(opline->result.var); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -18491,7 +18533,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } break; } @@ -18507,7 +18549,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE incdec_op(zptr); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, zptr); + ZVAL_COPY(EX_VAR(opline->result.var), zptr); } } else { zval rv; @@ -18532,7 +18574,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE SEPARATE_ZVAL_NOREF(z); incdec_op(z); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, z); + ZVAL_COPY(EX_VAR(opline->result.var), z); } Z_OBJ_HT(obj)->write_property(&obj, property, z, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL)); OBJ_RELEASE(Z_OBJ(obj)); @@ -18540,7 +18582,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } @@ -18567,19 +18609,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zend_free_op free_op1; zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); - retval = EX_VAR(opline->result.var); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -18592,7 +18634,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP ZVAL_DEREF(object); if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); break; } } @@ -18603,7 +18645,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) { ZVAL_DEREF(zptr); - ZVAL_COPY_VALUE(retval, zptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), zptr); zval_opt_copy_ctor(zptr); incdec_op(zptr); } else { @@ -18624,7 +18666,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP } ZVAL_COPY_VALUE(z, value); } - ZVAL_DUP(retval, z); + ZVAL_DUP(EX_VAR(opline->result.var), z); ZVAL_DUP(&z_copy, z); incdec_op(&z_copy); if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z); @@ -18634,7 +18676,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zval_ptr_dtor(z); } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } while (0); @@ -18781,13 +18823,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLE SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -18958,13 +19002,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_CV_HA SAVE_OPLINE(); container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); @@ -18990,13 +19036,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_CV_HANDLER SAVE_OPLINE(); object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); @@ -19755,13 +19803,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP SAVE_OPLINE(); object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); @@ -20181,19 +20232,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE zend_free_op free_op1, free_op2; zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); - retval = EX_VAR(opline->result.var); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); @@ -20207,7 +20258,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } break; } @@ -20223,7 +20274,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE incdec_op(zptr); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, zptr); + ZVAL_COPY(EX_VAR(opline->result.var), zptr); } } else { zval rv; @@ -20248,7 +20299,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE SEPARATE_ZVAL_NOREF(z); incdec_op(z); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, z); + ZVAL_COPY(EX_VAR(opline->result.var), z); } Z_OBJ_HT(obj)->write_property(&obj, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL)); OBJ_RELEASE(Z_OBJ(obj)); @@ -20256,7 +20307,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } @@ -20284,19 +20335,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zend_free_op free_op1, free_op2; zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); - retval = EX_VAR(opline->result.var); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); @@ -20309,7 +20360,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP ZVAL_DEREF(object); if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); break; } } @@ -20320,7 +20371,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) { ZVAL_DEREF(zptr); - ZVAL_COPY_VALUE(retval, zptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), zptr); zval_opt_copy_ctor(zptr); incdec_op(zptr); } else { @@ -20341,7 +20392,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP } ZVAL_COPY_VALUE(z, value); } - ZVAL_DUP(retval, z); + ZVAL_DUP(EX_VAR(opline->result.var), z); ZVAL_DUP(&z_copy, z); incdec_op(&z_copy); if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z); @@ -20351,7 +20402,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zval_ptr_dtor(z); } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } while (0); @@ -20499,13 +20550,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_TMPVAR_HA SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -20677,13 +20730,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_VAR_TMPVA SAVE_OPLINE(); container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_VAR == IS_VAR && UNEXPECTED(container == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); @@ -20709,13 +20764,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_VAR_TMPVAR_HAN SAVE_OPLINE(); object = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1); - property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_VAR == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_VAR == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(free_op2); @@ -21351,13 +21408,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP SAVE_OPLINE(); object = _get_obj_zval_ptr_unused(execute_data); - property = EX_CONSTANT(opline->op2); + if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } + + property = EX_CONSTANT(opline->op2); + if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); @@ -21737,19 +21797,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_obj_zval_ptr_unused(execute_data); - property = EX_CONSTANT(opline->op2); - retval = EX_VAR(opline->result.var); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = EX_CONSTANT(opline->op2); + if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -21763,7 +21823,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } break; } @@ -21779,7 +21839,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE incdec_op(zptr); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, zptr); + ZVAL_COPY(EX_VAR(opline->result.var), zptr); } } else { zval rv; @@ -21804,7 +21864,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE SEPARATE_ZVAL_NOREF(z); incdec_op(z); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, z); + ZVAL_COPY(EX_VAR(opline->result.var), z); } Z_OBJ_HT(obj)->write_property(&obj, property, z, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL)); OBJ_RELEASE(Z_OBJ(obj)); @@ -21812,7 +21872,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } @@ -21839,19 +21899,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_obj_zval_ptr_unused(execute_data); - property = EX_CONSTANT(opline->op2); - retval = EX_VAR(opline->result.var); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = EX_CONSTANT(opline->op2); + if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -21864,7 +21924,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP ZVAL_DEREF(object); if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); break; } } @@ -21875,7 +21935,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) { ZVAL_DEREF(zptr); - ZVAL_COPY_VALUE(retval, zptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), zptr); zval_opt_copy_ctor(zptr); incdec_op(zptr); } else { @@ -21896,7 +21956,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP } ZVAL_COPY_VALUE(z, value); } - ZVAL_DUP(retval, z); + ZVAL_DUP(EX_VAR(opline->result.var), z); ZVAL_DUP(&z_copy, z); incdec_op(&z_copy); if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z); @@ -21906,7 +21966,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zval_ptr_dtor(z); } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } while (0); @@ -21936,13 +21996,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_ SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - offset = EX_CONSTANT(opline->op2); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -22071,13 +22133,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - offset = EX_CONSTANT(opline->op2); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -22183,13 +22247,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CO SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - property = EX_CONSTANT(opline->op2); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = EX_CONSTANT(opline->op2); + if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); @@ -22215,13 +22281,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_H SAVE_OPLINE(); object = _get_obj_zval_ptr_unused(execute_data); - property_name = EX_CONSTANT(opline->op2); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property_name = EX_CONSTANT(opline->op2); + if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); @@ -22636,13 +22704,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNU SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - offset = EX_CONSTANT(opline->op2); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + isset_dim_obj_again: if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { HashTable *ht = Z_ARRVAL_P(container); @@ -22757,13 +22827,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UN SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - offset = EX_CONSTANT(opline->op2); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -23729,13 +23801,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP SAVE_OPLINE(); object = _get_obj_zval_ptr_unused(execute_data); - property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); @@ -24115,19 +24190,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_obj_zval_ptr_unused(execute_data); - property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); - retval = EX_VAR(opline->result.var); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -24141,7 +24216,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } break; } @@ -24157,7 +24232,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE incdec_op(zptr); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, zptr); + ZVAL_COPY(EX_VAR(opline->result.var), zptr); } } else { zval rv; @@ -24182,7 +24257,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE SEPARATE_ZVAL_NOREF(z); incdec_op(z); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, z); + ZVAL_COPY(EX_VAR(opline->result.var), z); } Z_OBJ_HT(obj)->write_property(&obj, property, z, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL)); OBJ_RELEASE(Z_OBJ(obj)); @@ -24190,7 +24265,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } @@ -24217,19 +24292,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_obj_zval_ptr_unused(execute_data); - property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); - retval = EX_VAR(opline->result.var); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -24242,7 +24317,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP ZVAL_DEREF(object); if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); break; } } @@ -24253,7 +24328,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) { ZVAL_DEREF(zptr); - ZVAL_COPY_VALUE(retval, zptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), zptr); zval_opt_copy_ctor(zptr); incdec_op(zptr); } else { @@ -24274,7 +24349,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP } ZVAL_COPY_VALUE(z, value); } - ZVAL_DUP(retval, z); + ZVAL_DUP(EX_VAR(opline->result.var), z); ZVAL_DUP(&z_copy, z); incdec_op(&z_copy); if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z); @@ -24284,7 +24359,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zval_ptr_dtor(z); } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } while (0); @@ -24314,13 +24389,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HAN SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -24449,13 +24526,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HA SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -24561,13 +24640,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); @@ -24593,13 +24674,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HAND SAVE_OPLINE(); object = _get_obj_zval_ptr_unused(execute_data); - property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); @@ -24914,13 +24997,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNU SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + isset_dim_obj_again: if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { HashTable *ht = Z_ARRVAL_P(container); @@ -25035,13 +25120,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UN SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -25218,13 +25305,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP SAVE_OPLINE(); object = _get_obj_zval_ptr_unused(execute_data); - property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); @@ -25605,19 +25695,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE zend_free_op free_op2; zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_obj_zval_ptr_unused(execute_data); - property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); - retval = EX_VAR(opline->result.var); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); @@ -25631,7 +25721,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } break; } @@ -25647,7 +25737,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE incdec_op(zptr); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, zptr); + ZVAL_COPY(EX_VAR(opline->result.var), zptr); } } else { zval rv; @@ -25672,7 +25762,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE SEPARATE_ZVAL_NOREF(z); incdec_op(z); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, z); + ZVAL_COPY(EX_VAR(opline->result.var), z); } Z_OBJ_HT(obj)->write_property(&obj, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL)); OBJ_RELEASE(Z_OBJ(obj)); @@ -25680,7 +25770,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } @@ -25708,19 +25798,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zend_free_op free_op2; zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_obj_zval_ptr_unused(execute_data); - property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); - retval = EX_VAR(opline->result.var); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); @@ -25733,7 +25823,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP ZVAL_DEREF(object); if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); break; } } @@ -25744,7 +25834,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) { ZVAL_DEREF(zptr); - ZVAL_COPY_VALUE(retval, zptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), zptr); zval_opt_copy_ctor(zptr); incdec_op(zptr); } else { @@ -25765,7 +25855,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP } ZVAL_COPY_VALUE(z, value); } - ZVAL_DUP(retval, z); + ZVAL_DUP(EX_VAR(opline->result.var), z); ZVAL_DUP(&z_copy, z); incdec_op(&z_copy); if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z); @@ -25775,7 +25865,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zval_ptr_dtor(z); } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } while (0); @@ -25806,13 +25896,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -25942,13 +26034,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVA SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -26055,13 +26149,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TM SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); @@ -26087,13 +26183,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMPVAR_ SAVE_OPLINE(); object = _get_obj_zval_ptr_unused(execute_data); - property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(free_op2); @@ -26410,13 +26508,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNU SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + isset_dim_obj_again: if (IS_UNUSED != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { HashTable *ht = Z_ARRVAL_P(container); @@ -26532,13 +26632,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UN SAVE_OPLINE(); container = _get_obj_zval_ptr_unused(execute_data); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_UNUSED == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -28720,13 +28822,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP SAVE_OPLINE(); object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); - property = EX_CONSTANT(opline->op2); + if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } + + property = EX_CONSTANT(opline->op2); + if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); @@ -29144,19 +29249,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); - property = EX_CONSTANT(opline->op2); - retval = EX_VAR(opline->result.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = EX_CONSTANT(opline->op2); + if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -29170,7 +29275,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } break; } @@ -29186,7 +29291,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE incdec_op(zptr); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, zptr); + ZVAL_COPY(EX_VAR(opline->result.var), zptr); } } else { zval rv; @@ -29211,7 +29316,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE SEPARATE_ZVAL_NOREF(z); incdec_op(z); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, z); + ZVAL_COPY(EX_VAR(opline->result.var), z); } Z_OBJ_HT(obj)->write_property(&obj, property, z, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL)); OBJ_RELEASE(Z_OBJ(obj)); @@ -29219,7 +29324,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } @@ -29246,19 +29351,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); - property = EX_CONSTANT(opline->op2); - retval = EX_VAR(opline->result.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = EX_CONSTANT(opline->op2); + if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -29271,7 +29376,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP ZVAL_DEREF(object); if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); break; } } @@ -29282,7 +29387,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) { ZVAL_DEREF(zptr); - ZVAL_COPY_VALUE(retval, zptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), zptr); zval_opt_copy_ctor(zptr); incdec_op(zptr); } else { @@ -29303,7 +29408,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP } ZVAL_COPY_VALUE(z, value); } - ZVAL_DUP(retval, z); + ZVAL_DUP(EX_VAR(opline->result.var), z); ZVAL_DUP(&z_copy, z); incdec_op(&z_copy); if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z); @@ -29313,7 +29418,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zval_ptr_dtor(z); } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } while (0); @@ -29674,13 +29779,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HAND SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var); - offset = EX_CONSTANT(opline->op2); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -29809,13 +29916,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HAN SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); - offset = EX_CONSTANT(opline->op2); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -29921,13 +30030,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CONST_ SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); - property = EX_CONSTANT(opline->op2); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = EX_CONSTANT(opline->op2); + if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); @@ -29989,13 +30100,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDL SAVE_OPLINE(); object = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); - property_name = EX_CONSTANT(opline->op2); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property_name = EX_CONSTANT(opline->op2); + if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); @@ -30799,13 +30912,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_ SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); - offset = EX_CONSTANT(opline->op2); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + isset_dim_obj_again: if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { HashTable *ht = Z_ARRVAL_P(container); @@ -30920,13 +31035,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); - offset = EX_CONSTANT(opline->op2); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -33827,13 +33944,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP SAVE_OPLINE(); object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); - property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); @@ -34251,19 +34371,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); - property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); - retval = EX_VAR(opline->result.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -34277,7 +34397,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } break; } @@ -34293,7 +34413,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE incdec_op(zptr); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, zptr); + ZVAL_COPY(EX_VAR(opline->result.var), zptr); } } else { zval rv; @@ -34318,7 +34438,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE SEPARATE_ZVAL_NOREF(z); incdec_op(z); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, z); + ZVAL_COPY(EX_VAR(opline->result.var), z); } Z_OBJ_HT(obj)->write_property(&obj, property, z, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL)); OBJ_RELEASE(Z_OBJ(obj)); @@ -34326,7 +34446,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } @@ -34353,19 +34473,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); - property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); - retval = EX_VAR(opline->result.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); @@ -34378,7 +34498,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP ZVAL_DEREF(object); if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); break; } } @@ -34389,7 +34509,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) { ZVAL_DEREF(zptr); - ZVAL_COPY_VALUE(retval, zptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), zptr); zval_opt_copy_ctor(zptr); incdec_op(zptr); } else { @@ -34410,7 +34530,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP } ZVAL_COPY_VALUE(z, value); } - ZVAL_DUP(retval, z); + ZVAL_DUP(EX_VAR(opline->result.var), z); ZVAL_DUP(&z_copy, z); incdec_op(&z_copy); if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z); @@ -34420,7 +34540,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zval_ptr_dtor(z); } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } while (0); @@ -34597,13 +34717,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -34732,13 +34854,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLE SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -34844,13 +34968,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_CV_HAN SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); - property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); @@ -34876,13 +35002,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_CV_HANDLER( SAVE_OPLINE(); object = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); - property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); @@ -35567,13 +35695,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_ SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + isset_dim_obj_again: if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { HashTable *ht = Z_ARRVAL_P(container); @@ -35688,13 +35818,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -36422,13 +36554,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP SAVE_OPLINE(); object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); - property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); FREE_UNFETCHED_OP((opline+1)->op1_type, (opline+1)->op1.var); @@ -36848,19 +36983,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE zend_free_op free_op2; zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); - property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); - retval = EX_VAR(opline->result.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); @@ -36874,7 +37009,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } break; } @@ -36890,7 +37025,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE incdec_op(zptr); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, zptr); + ZVAL_COPY(EX_VAR(opline->result.var), zptr); } } else { zval rv; @@ -36915,7 +37050,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE SEPARATE_ZVAL_NOREF(z); incdec_op(z); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(retval, z); + ZVAL_COPY(EX_VAR(opline->result.var), z); } Z_OBJ_HT(obj)->write_property(&obj, property, z, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL)); OBJ_RELEASE(Z_OBJ(obj)); @@ -36923,7 +37058,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } @@ -36951,19 +37086,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zend_free_op free_op2; zval *object; zval *property; - zval *retval; zval *zptr; SAVE_OPLINE(); object = _get_zval_ptr_cv_BP_VAR_RW(execute_data, opline->op1.var); - property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); - retval = EX_VAR(opline->result.var); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot increment/decrement overloaded objects nor string offsets"); zval_ptr_dtor_nogc(free_op2); @@ -36976,7 +37111,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP ZVAL_DEREF(object); if (UNEXPECTED(!make_real_object(object))) { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); break; } } @@ -36987,7 +37122,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(Z_CACHE_SLOT_P(property)) : NULL))) != NULL)) { ZVAL_DEREF(zptr); - ZVAL_COPY_VALUE(retval, zptr); + ZVAL_COPY_VALUE(EX_VAR(opline->result.var), zptr); zval_opt_copy_ctor(zptr); incdec_op(zptr); } else { @@ -37008,7 +37143,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP } ZVAL_COPY_VALUE(z, value); } - ZVAL_DUP(retval, z); + ZVAL_DUP(EX_VAR(opline->result.var), z); ZVAL_DUP(&z_copy, z); incdec_op(&z_copy); if (Z_REFCOUNTED_P(z)) Z_ADDREF_P(z); @@ -37018,7 +37153,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP zval_ptr_dtor(z); } else { zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(retval); + ZVAL_NULL(EX_VAR(opline->result.var)); } } } while (0); @@ -37196,13 +37331,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HAN SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -37332,13 +37469,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_HA SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -37445,13 +37584,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_UNSET_SPEC_CV_TMPVAR SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var); - property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_CV == IS_VAR && UNEXPECTED(container == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an object"); zval_ptr_dtor_nogc(free_op2); @@ -37477,13 +37618,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ASSIGN_OBJ_SPEC_CV_TMPVAR_HAND SAVE_OPLINE(); object = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var); - property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(object) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_CV == IS_VAR && UNEXPECTED(object == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Cannot use string offset as an array"); zval_ptr_dtor_nogc(free_op2); @@ -38076,13 +38219,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_CV_ SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + isset_dim_obj_again: if (IS_CV != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { HashTable *ht = Z_ARRVAL_P(container); @@ -38198,13 +38343,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV SAVE_OPLINE(); container = _get_zval_ptr_cv_BP_VAR_IS(execute_data, opline->op1.var); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if (IS_CV == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -39568,13 +39715,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); - offset = EX_CONSTANT(opline->op2); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -40057,13 +40206,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); - offset = EX_CONSTANT(opline->op2); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + isset_dim_obj_again: if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { HashTable *ht = Z_ARRVAL_P(container); @@ -40178,13 +40329,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TM SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); - offset = EX_CONSTANT(opline->op2); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = EX_CONSTANT(opline->op2); + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -41618,13 +41771,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_HA SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -41889,13 +42044,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + isset_dim_obj_again: if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { HashTable *ht = Z_ARRVAL_P(container); @@ -42010,13 +42167,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TM SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); - offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var); + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -42630,13 +42789,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVA SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); @@ -42903,13 +43064,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_TMP SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + isset_dim_obj_again: if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && EXPECTED(Z_TYPE_P(container) == IS_ARRAY)) { HashTable *ht = Z_ARRVAL_P(container); @@ -43025,13 +43188,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TM SAVE_OPLINE(); container = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1); - offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); if ((IS_TMP_VAR|IS_VAR) == IS_UNUSED && UNEXPECTED(Z_OBJ_P(container) == NULL)) { zend_error(E_EXCEPTION | E_ERROR, "Using $this when not in object context"); - zval_ptr_dtor_nogc(free_op2); + zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); HANDLE_EXCEPTION(); } + + offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2); + if ((IS_TMP_VAR|IS_VAR) != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); -- 2.40.0