]> granicus.if.org Git - php/commitdiff
simplified code
authorDmitry Stogov <dmitry@zend.com>
Tue, 9 Dec 2014 09:17:55 +0000 (12:17 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 9 Dec 2014 09:17:55 +0000 (12:17 +0300)
Zend/zend_execute.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index f6902bf6ca66f759f1e50b86538b7f051a8dded5..3127c39d1030390ad472baaac1d291c7bb7737ed 100644 (file)
@@ -401,11 +401,10 @@ static inline zval *_get_zval_ptr(int op_type, znode_op node, const zend_execute
                case IS_VAR:
                        return _get_zval_ptr_var(node.var, execute_data, should_free);
                case IS_CV:
-                       *should_free = NULL;
-                       return _get_zval_ptr_cv(execute_data, node.var, type TSRMLS_CC);
                default:
+                       ZEND_ASSERT(op_type == IS_CV);
                        *should_free = NULL;
-                       return NULL;
+                       return _get_zval_ptr_cv(execute_data, node.var, type TSRMLS_CC);
        }
 }
 
@@ -420,11 +419,10 @@ static inline zval *_get_zval_ptr_deref(int op_type, znode_op node, const zend_e
                case IS_VAR:
                        return _get_zval_ptr_var_deref(node.var, execute_data, should_free);
                case IS_CV:
-                       *should_free = NULL;
-                       return _get_zval_ptr_cv_deref(execute_data, node.var, type TSRMLS_CC);
                default:
+                       ZEND_ASSERT(op_type == IS_CV);
                        *should_free = NULL;
-                       return NULL;
+                       return _get_zval_ptr_cv_deref(execute_data, node.var, type TSRMLS_CC);
        }
 }
 
@@ -508,20 +506,23 @@ static inline void zend_assign_to_variable_reference(zval *variable_ptr, zval *v
 }
 
 /* this should modify object only if it's empty */
-static inline zval* make_real_object(zval *object_ptr TSRMLS_DC)
+static inline int make_real_object(zval **object_ptr TSRMLS_DC)
 {
-       zval *object = object_ptr;
+       zval *object = *object_ptr;
 
        ZVAL_DEREF(object);
        if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-               if (Z_TYPE_P(object) <= IS_FALSE
+               if (EXPECTED(Z_TYPE_P(object) <= IS_FALSE)
                        || (Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0)) {
                        zval_ptr_dtor_nogc(object);
                        object_init(object);
                        zend_error(E_WARNING, "Creating default object from empty value");
+               } else {
+                       return 0;
                }
        }
-       return object;
+       *object_ptr = object;
+       return 1;
 }
 
 ZEND_API char * zend_verify_internal_arg_class_kind(const zend_internal_arg_info *cur_arg_info, char **class_name, zend_class_entry **pce TSRMLS_DC)
index a76d55493ce083820b64209c01063f146472df3f..c0f6e40916964843d0d86569be62b5f2f96ae69e 100644 (file)
@@ -347,10 +347,10 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|
        }
 
        do {
+               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+
                if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to assign property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(EX_VAR(opline->result.var));
@@ -359,8 +359,6 @@ ZEND_VM_HELPER_EX(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|
                        }
                }
 
-               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-
                /* here we are sure we are dealing with an object */
                if (opline->extended_value == ZEND_ASSIGN_OBJ
                        && EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
@@ -759,8 +757,7 @@ ZEND_VM_HELPER_EX(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|C
 
        do {
                if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(retval);
@@ -848,8 +845,7 @@ ZEND_VM_HELPER_EX(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|
 
        do {
                if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                ZVAL_NULL(retval);
                                break;
index 42ca0d6c14b5c0c4a3dc05a6086fa3323c06966e..4addf39d0104cc20bcd98e1060f3cd7af1fa95b9 100644 (file)
@@ -12138,10 +12138,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
        }
 
        do {
+               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+
                if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to assign property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(EX_VAR(opline->result.var));
@@ -12150,8 +12150,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CONST(int (*b
                        }
                }
 
-               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-
                /* here we are sure we are dealing with an object */
                if (opline->extended_value == ZEND_ASSIGN_OBJ
                        && EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
@@ -12548,8 +12546,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CONST(incdec_t
 
        do {
                if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(retval);
@@ -12636,8 +12633,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CONST(incdec_
 
        do {
                if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                ZVAL_NULL(retval);
                                break;
@@ -15012,10 +15008,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
        }
 
        do {
+               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+
                if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to assign property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(EX_VAR(opline->result.var));
@@ -15024,8 +15020,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_CV(int (*bina
                        }
                }
 
-               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-
                /* here we are sure we are dealing with an object */
                if (opline->extended_value == ZEND_ASSIGN_OBJ
                        && EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
@@ -15422,8 +15416,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_CV(incdec_t in
 
        do {
                if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(retval);
@@ -15510,8 +15503,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_CV(incdec_t i
 
        do {
                if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                ZVAL_NULL(retval);
                                break;
@@ -16546,10 +16538,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMPVAR(int (*
        }
 
        do {
+               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+
                if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to assign property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(EX_VAR(opline->result.var));
@@ -16558,8 +16550,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_VAR_TMPVAR(int (*
                        }
                }
 
-               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-
                /* here we are sure we are dealing with an object */
                if (opline->extended_value == ZEND_ASSIGN_OBJ
                        && EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
@@ -16958,8 +16948,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_VAR_TMPVAR(incdec_
 
        do {
                if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(retval);
@@ -17047,8 +17036,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_VAR_TMPVAR(incdec
 
        do {
                if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                ZVAL_NULL(retval);
                                break;
@@ -17955,10 +17943,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
        }
 
        do {
+               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+
                if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to assign property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(EX_VAR(opline->result.var));
@@ -17967,8 +17955,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
                        }
                }
 
-               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-
                /* here we are sure we are dealing with an object */
                if (opline->extended_value == ZEND_ASSIGN_OBJ
                        && EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
@@ -18329,8 +18315,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
 
        do {
                if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(retval);
@@ -18417,8 +18402,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
 
        do {
                if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                ZVAL_NULL(retval);
                                break;
@@ -20141,10 +20125,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
        }
 
        do {
+               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+
                if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to assign property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(EX_VAR(opline->result.var));
@@ -20153,8 +20137,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
                        }
                }
 
-               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-
                /* here we are sure we are dealing with an object */
                if (opline->extended_value == ZEND_ASSIGN_OBJ
                        && EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
@@ -20515,8 +20497,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
 
        do {
                if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(retval);
@@ -20603,8 +20584,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
 
        do {
                if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                ZVAL_NULL(retval);
                                break;
@@ -21529,10 +21509,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMPVAR(int
        }
 
        do {
+               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+
                if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to assign property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(EX_VAR(opline->result.var));
@@ -21541,8 +21521,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMPVAR(int
                        }
                }
 
-               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-
                /* here we are sure we are dealing with an object */
                if (opline->extended_value == ZEND_ASSIGN_OBJ
                        && EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
@@ -21904,8 +21882,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMPVAR(incd
 
        do {
                if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(retval);
@@ -21993,8 +21970,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMPVAR(inc
 
        do {
                if (IS_UNUSED != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                ZVAL_NULL(retval);
                                break;
@@ -24510,10 +24486,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
        }
 
        do {
+               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+
                if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to assign property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(EX_VAR(opline->result.var));
@@ -24522,8 +24498,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CONST(int (*bi
                        }
                }
 
-               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-
                /* here we are sure we are dealing with an object */
                if (opline->extended_value == ZEND_ASSIGN_OBJ
                        && EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
@@ -24919,8 +24893,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CONST(incdec_t
 
        do {
                if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(retval);
@@ -25007,8 +24980,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CONST(incdec_t
 
        do {
                if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                ZVAL_NULL(retval);
                                break;
@@ -28713,10 +28685,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
        }
 
        do {
+               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+
                if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to assign property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(EX_VAR(opline->result.var));
@@ -28725,8 +28697,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_CV(int (*binar
                        }
                }
 
-               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-
                /* here we are sure we are dealing with an object */
                if (opline->extended_value == ZEND_ASSIGN_OBJ
                        && EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
@@ -29122,8 +29092,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_CV(incdec_t inc
 
        do {
                if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(retval);
@@ -29210,8 +29179,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_CV(incdec_t in
 
        do {
                if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                ZVAL_NULL(retval);
                                break;
@@ -30758,10 +30726,10 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMPVAR(int (*b
        }
 
        do {
+               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
+
                if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to assign property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(EX_VAR(opline->result.var));
@@ -30770,8 +30738,6 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_CV_TMPVAR(int (*b
                        }
                }
 
-               value = get_zval_ptr_deref((opline+1)->op1_type, (opline+1)->op1, execute_data, &free_op_data1, BP_VAR_R);
-
                /* here we are sure we are dealing with an object */
                if (opline->extended_value == ZEND_ASSIGN_OBJ
                        && EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr)
@@ -31169,8 +31135,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_CV_TMPVAR(incdec_t
 
        do {
                if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC);
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                if (RETURN_VALUE_USED(opline)) {
                                        ZVAL_NULL(retval);
@@ -31258,8 +31223,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_CV_TMPVAR(incdec_
 
        do {
                if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
-                       object = make_real_object(object TSRMLS_CC); /* this should modify object only if it's empty */
-                       if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
+                       if (UNEXPECTED(!make_real_object(&object TSRMLS_CC))) {
                                zend_error(E_WARNING, "Attempt to increment/decrement property of non-object");
                                ZVAL_NULL(retval);
                                break;