]> granicus.if.org Git - php/commitdiff
Fix early free of assign_obj op_data
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 20 Dec 2019 09:33:18 +0000 (10:33 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 20 Dec 2019 09:35:34 +0000 (10:35 +0100)
We need to make sure that op_data is only freed after populating
result, as op_data may be the only thing holding the value in the
case of an overloaded assignment.

This reverts the code to how it looked like in 7.3.

Zend/tests/overloaded_assign_prop_return_value.phpt [new file with mode: 0644]
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

diff --git a/Zend/tests/overloaded_assign_prop_return_value.phpt b/Zend/tests/overloaded_assign_prop_return_value.phpt
new file mode 100644 (file)
index 0000000..954505f
--- /dev/null
@@ -0,0 +1,14 @@
+--TEST--
+Make sure the return value of a property assignment is not freed to early
+--FILE--
+<?php
+class Overloaded {
+    function __set($r, $a) {}
+}
+$obj = new Overloaded;
+$x = $obj->prop = new stdClass;
+var_dump($x);
+?>
+--EXPECT--
+object(stdClass)#2 (0) {
+}
index 66a4c6be31214a4fbcea05b83cb6402807aeac05..61242d6130c5c2d40c82086983f09ec10697fd39 100644 (file)
@@ -2495,6 +2495,9 @@ ZEND_VM_C_LABEL(assign_object):
                                } else {
 ZEND_VM_C_LABEL(fast_assign_obj):
                                        value = zend_assign_to_variable(property_val, value, OP_DATA_TYPE, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        ZEND_VM_C_GOTO(exit_assign_obj);
                                }
                        }
@@ -2542,6 +2545,9 @@ ZEND_VM_C_LABEL(fast_assign_obj):
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                ZEND_VM_C_GOTO(exit_assign_obj);
                        }
                }
@@ -2554,11 +2560,11 @@ ZEND_VM_C_LABEL(fast_assign_obj):
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 ZEND_VM_C_LABEL(free_and_exit_assign_obj):
-       FREE_OP_DATA();
-ZEND_VM_C_LABEL(exit_assign_obj):
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       FREE_OP_DATA();
+ZEND_VM_C_LABEL(exit_assign_obj):
        FREE_OP2();
        FREE_OP1_VAR_PTR();
        /* assign_obj has two opcodes! */
index f5346d0d57dec556039b6792de005ff7649ca05a..7fc4d1f691e19cec442c568f87e23e564934a22e 100644 (file)
@@ -22603,6 +22603,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CONST, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -22650,6 +22653,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -22662,12 +22668,12 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
 
+exit_assign_obj:
+
        if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
        /* assign_obj has two opcodes! */
        ZEND_VM_NEXT_OPCODE_EX(1, 2);
@@ -22732,6 +22738,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -22779,6 +22788,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -22791,11 +22803,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
 
        if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
        /* assign_obj has two opcodes! */
@@ -22861,6 +22873,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -22908,6 +22923,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -22920,11 +22938,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
 
        if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
        /* assign_obj has two opcodes! */
@@ -22990,6 +23008,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CV, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -23037,6 +23058,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -23049,12 +23073,12 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
 
+exit_assign_obj:
+
        if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
        /* assign_obj has two opcodes! */
        ZEND_VM_NEXT_OPCODE_EX(1, 2);
@@ -24881,6 +24905,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CONST, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -24928,6 +24955,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -24940,11 +24970,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+
+exit_assign_obj:
        zval_ptr_dtor_nogc(free_op2);
        if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
        /* assign_obj has two opcodes! */
@@ -25010,6 +25040,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -25057,6 +25090,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -25069,11 +25105,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
        zval_ptr_dtor_nogc(free_op2);
        if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
        /* assign_obj has two opcodes! */
@@ -25139,6 +25175,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -25186,6 +25225,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -25198,11 +25240,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
        zval_ptr_dtor_nogc(free_op2);
        if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
        /* assign_obj has two opcodes! */
@@ -25268,6 +25310,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CV, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -25315,6 +25360,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -25327,11 +25375,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+
+exit_assign_obj:
        zval_ptr_dtor_nogc(free_op2);
        if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
        /* assign_obj has two opcodes! */
@@ -28546,6 +28594,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CONST, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -28593,6 +28644,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -28605,12 +28659,12 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
 
+exit_assign_obj:
+
        if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
        /* assign_obj has two opcodes! */
        ZEND_VM_NEXT_OPCODE_EX(1, 2);
@@ -28675,6 +28729,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -28722,6 +28779,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -28734,11 +28794,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
 
        if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
        /* assign_obj has two opcodes! */
@@ -28804,6 +28864,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -28851,6 +28914,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -28863,11 +28929,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
 
        if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
        /* assign_obj has two opcodes! */
@@ -28933,6 +28999,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CV, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -28980,6 +29049,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -28992,12 +29064,12 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
 
+exit_assign_obj:
+
        if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);};
        /* assign_obj has two opcodes! */
        ZEND_VM_NEXT_OPCODE_EX(1, 2);
@@ -31012,6 +31084,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CONST, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -31059,6 +31134,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -31071,12 +31149,12 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
 
+exit_assign_obj:
+
 
        /* assign_obj has two opcodes! */
        ZEND_VM_NEXT_OPCODE_EX(1, 2);
@@ -31141,6 +31219,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -31188,6 +31269,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -31200,11 +31284,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
 
 
        /* assign_obj has two opcodes! */
@@ -31270,6 +31354,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -31317,6 +31404,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -31329,11 +31419,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
 
 
        /* assign_obj has two opcodes! */
@@ -31399,6 +31489,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CV, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -31446,6 +31539,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -31458,12 +31554,12 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
 
+exit_assign_obj:
+
 
        /* assign_obj has two opcodes! */
        ZEND_VM_NEXT_OPCODE_EX(1, 2);
@@ -32824,6 +32920,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CONST, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -32871,6 +32970,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -32883,11 +32985,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+
+exit_assign_obj:
        zval_ptr_dtor_nogc(free_op2);
 
        /* assign_obj has two opcodes! */
@@ -32953,6 +33055,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -33000,6 +33105,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -33012,11 +33120,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
        zval_ptr_dtor_nogc(free_op2);
 
        /* assign_obj has two opcodes! */
@@ -33082,6 +33190,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -33129,6 +33240,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -33141,11 +33255,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
        zval_ptr_dtor_nogc(free_op2);
 
        /* assign_obj has two opcodes! */
@@ -33211,6 +33325,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CV, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -33258,6 +33375,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -33270,11 +33390,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+
+exit_assign_obj:
        zval_ptr_dtor_nogc(free_op2);
 
        /* assign_obj has two opcodes! */
@@ -35322,6 +35442,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CONST, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -35369,6 +35492,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -35381,12 +35507,12 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
 
+exit_assign_obj:
+
 
        /* assign_obj has two opcodes! */
        ZEND_VM_NEXT_OPCODE_EX(1, 2);
@@ -35451,6 +35577,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -35498,6 +35627,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -35510,11 +35642,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
 
 
        /* assign_obj has two opcodes! */
@@ -35580,6 +35712,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -35627,6 +35762,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -35639,11 +35777,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
 
 
        /* assign_obj has two opcodes! */
@@ -35709,6 +35847,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CV, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -35756,6 +35897,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -35768,12 +35912,12 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
 
+exit_assign_obj:
+
 
        /* assign_obj has two opcodes! */
        ZEND_VM_NEXT_OPCODE_EX(1, 2);
@@ -39659,6 +39803,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CONST, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -39706,6 +39853,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -39718,12 +39868,12 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
 
+exit_assign_obj:
+
 
        /* assign_obj has two opcodes! */
        ZEND_VM_NEXT_OPCODE_EX(1, 2);
@@ -39788,6 +39938,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -39835,6 +39988,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -39847,11 +40003,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
 
 
        /* assign_obj has two opcodes! */
@@ -39917,6 +40073,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -39964,6 +40123,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -39976,11 +40138,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
 
 
        /* assign_obj has two opcodes! */
@@ -40046,6 +40208,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CV, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -40093,6 +40258,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -40105,12 +40273,12 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
 
+exit_assign_obj:
+
 
        /* assign_obj has two opcodes! */
        ZEND_VM_NEXT_OPCODE_EX(1, 2);
@@ -43141,6 +43309,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CONST, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -43188,6 +43359,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -43200,11 +43374,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+
+exit_assign_obj:
        zval_ptr_dtor_nogc(free_op2);
 
        /* assign_obj has two opcodes! */
@@ -43270,6 +43444,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -43317,6 +43494,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -43329,11 +43509,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
        zval_ptr_dtor_nogc(free_op2);
 
        /* assign_obj has two opcodes! */
@@ -43399,6 +43579,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -43446,6 +43629,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -43458,11 +43644,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
        zval_ptr_dtor_nogc(free_op2);
 
        /* assign_obj has two opcodes! */
@@ -43528,6 +43714,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CV, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -43575,6 +43764,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -43587,11 +43779,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, ((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+
+exit_assign_obj:
        zval_ptr_dtor_nogc(free_op2);
 
        /* assign_obj has two opcodes! */
@@ -48211,6 +48403,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CONST, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -48258,6 +48453,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -48270,12 +48468,12 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
 
+exit_assign_obj:
+
 
        /* assign_obj has two opcodes! */
        ZEND_VM_NEXT_OPCODE_EX(1, 2);
@@ -48340,6 +48538,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_TMP_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -48387,6 +48588,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -48399,11 +48603,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
 
 
        /* assign_obj has two opcodes! */
@@ -48469,6 +48673,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_VAR, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -48516,6 +48723,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -48528,11 +48738,11 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-       zval_ptr_dtor_nogc(free_op_data);
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
+       zval_ptr_dtor_nogc(free_op_data);
+exit_assign_obj:
 
 
        /* assign_obj has two opcodes! */
@@ -48598,6 +48808,9 @@ assign_object:
                                } else {
 fast_assign_obj:
                                        value = zend_assign_to_variable(property_val, value, IS_CV, EX_USES_STRICT_TYPES());
+                                       if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                               ZVAL_COPY(EX_VAR(opline->result.var), value);
+                                       }
                                        goto exit_assign_obj;
                                }
                        }
@@ -48645,6 +48858,9 @@ fast_assign_obj:
                                        }
                                }
                                zend_hash_add_new(zobj->properties, Z_STR_P(property), value);
+                               if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
+                                       ZVAL_COPY(EX_VAR(opline->result.var), value);
+                               }
                                goto exit_assign_obj;
                        }
                }
@@ -48657,12 +48873,12 @@ fast_assign_obj:
        value = Z_OBJ_HT_P(object)->write_property(object, property, value, (IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL);
 
 free_and_exit_assign_obj:
-
-exit_assign_obj:
        if (UNEXPECTED(RETURN_VALUE_USED(opline))) {
                ZVAL_COPY(EX_VAR(opline->result.var), value);
        }
 
+exit_assign_obj:
+
 
        /* assign_obj has two opcodes! */
        ZEND_VM_NEXT_OPCODE_EX(1, 2);