]> granicus.if.org Git - php/commitdiff
Delayed unlikely checks for uninitialized variables
authorDmitry Stogov <dmitry@zend.com>
Thu, 23 Nov 2017 10:18:52 +0000 (13:18 +0300)
committerDmitry Stogov <dmitry@zend.com>
Thu, 23 Nov 2017 10:18:52 +0000 (13:18 +0300)
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index ebdca64f95cbcbf6fc9e2714d6c6138f7035944c..4993d762ffd6cf17c91ccc8b86b8a9de2fa2e485 100644 (file)
@@ -1757,24 +1757,31 @@ ZEND_VM_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMP|VAR|UNUSED|THIS|CV, CONST|TMPVAR
        void **cache_slot = NULL;
 
        SAVE_OPLINE();
-       container = GET_OP1_OBJ_ZVAL_PTR(BP_VAR_R);
+       container = GET_OP1_OBJ_ZVAL_PTR_UNDEF(BP_VAR_R);
 
        if (OP1_TYPE == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
                ZEND_VM_DISPATCH_TO_HELPER(zend_this_not_in_object_context_helper);
        }
 
-       offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
+       offset = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R);
 
        if (OP1_TYPE == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               ZEND_VM_C_GOTO(fetch_obj_r_no_object);
+           do {
+                       if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        ZEND_VM_C_GOTO(fetch_obj_r_no_object);
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -1822,6 +1829,8 @@ ZEND_VM_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMP|VAR|UNUSED|THIS|CV, CONST|TMPVAR
                                        }
                                }
                        }
+               } else if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -1908,18 +1917,19 @@ ZEND_VM_HANDLER(91, ZEND_FETCH_OBJ_IS, CONST|TMPVAR|UNUSED|THIS|CV, CONST|TMPVAR
                ZEND_VM_DISPATCH_TO_HELPER(zend_this_not_in_object_context_helper);
        }
 
-       offset  = GET_OP2_ZVAL_PTR(BP_VAR_R);
+       offset = GET_OP2_ZVAL_PTR(BP_VAR_R);
 
        if (OP1_TYPE == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               ZEND_VM_C_GOTO(fetch_obj_is_no_object);
+               do {
+                       if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
                        }
-               } else {
                        ZEND_VM_C_GOTO(fetch_obj_is_no_object);
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
index 6f1a607a1e93503922a987391660b1b06c079e58..492d500035e79cd78c3cf3380f6cc2410b6fc05f 100644 (file)
@@ -4998,14 +4998,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_H
 
        if (IS_CONST == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -5053,6 +5060,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CONST_H
                                        }
                                }
                        }
+               } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -5091,18 +5100,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CONST_
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset  = RT_CONSTANT(opline, opline->op2);
+       offset = RT_CONSTANT(opline, opline->op2);
 
        if (IS_CONST == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_is_no_object;
+               do {
+                       if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
                        }
-               } else {
                        goto fetch_obj_is_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -9089,18 +9099,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HAND
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
+       offset = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
 
        if (IS_CONST == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -9148,6 +9165,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_CV_HAND
                                        }
                                }
                        }
+               } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -9186,18 +9205,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_CV_HAN
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset  = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
+       offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
 
        if (IS_CONST == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_is_no_object;
+               do {
+                       if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
                        }
-               } else {
                        goto fetch_obj_is_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -11156,14 +11176,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR_
 
        if (IS_CONST == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -11211,6 +11238,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CONST_TMPVAR_
                                        }
                                }
                        }
+               } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -11250,18 +11279,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CONST_TMPVAR
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset  = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
+       offset = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
 
        if (IS_CONST == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_is_no_object;
+               do {
+                       if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
                        }
-               } else {
                        goto fetch_obj_is_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -13681,14 +13711,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CONST_HAN
 
        if (IS_TMP_VAR == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -13736,6 +13773,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CONST_HAN
                                        }
                                }
                        }
+               } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -15043,18 +15082,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CV_HANDLE
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
+       offset = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
 
        if (IS_TMP_VAR == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -15102,6 +15148,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_CV_HANDLE
                                        }
                                }
                        }
+               } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -15591,14 +15639,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_TMPVAR_HA
 
        if (IS_TMP_VAR == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_TMP_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_TMP_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -15646,6 +15701,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMP_TMPVAR_HA
                                        }
                                }
                        }
+               } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -18414,14 +18471,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HAN
 
        if (IS_VAR == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -18469,6 +18533,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CONST_HAN
                                        }
                                }
                        }
+               } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -22714,18 +22780,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLE
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
+       offset = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
 
        if (IS_VAR == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -22773,6 +22846,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_CV_HANDLE
                                        }
                                }
                        }
+               } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -25319,14 +25394,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_TMPVAR_HA
 
        if (IS_VAR == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_VAR & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_VAR == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -25374,6 +25456,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_VAR_TMPVAR_HA
                                        }
                                }
                        }
+               } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -27373,14 +27457,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_
 
        if (IS_UNUSED == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -27428,6 +27519,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_
                                        }
                                }
                        }
+               } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -27513,18 +27606,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset  = RT_CONSTANT(opline, opline->op2);
+       offset = RT_CONSTANT(opline, opline->op2);
 
        if (IS_UNUSED == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_is_no_object;
+               do {
+                       if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
                        }
-               } else {
                        goto fetch_obj_is_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -29993,18 +30087,25 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HAN
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
+       offset = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
 
        if (IS_UNUSED == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -30052,6 +30153,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HAN
                                        }
                                }
                        }
+               } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -30137,18 +30240,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HA
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset  = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
+       offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
 
        if (IS_UNUSED == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_is_no_object;
+               do {
+                       if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
                        }
-               } else {
                        goto fetch_obj_is_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -31742,14 +31846,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR
 
        if (IS_UNUSED == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -31797,6 +31908,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR
                                        }
                                }
                        }
+               } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -31883,18 +31996,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVA
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset  = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
+       offset = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
 
        if (IS_UNUSED == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_is_no_object;
+               do {
+                       if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
                        }
-               } else {
                        goto fetch_obj_is_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -36286,7 +36400,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HAND
        void **cache_slot = NULL;
 
        SAVE_OPLINE();
-       container = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
+       container = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
 
        if (IS_CV == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
@@ -36296,14 +36410,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HAND
 
        if (IS_CV == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -36351,6 +36472,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CONST_HAND
                                        }
                                }
                        }
+               } else if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -36436,18 +36559,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HAN
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset  = RT_CONSTANT(opline, opline->op2);
+       offset = RT_CONSTANT(opline, opline->op2);
 
        if (IS_CV == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_is_no_object;
+               do {
+                       if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
                        }
-               } else {
                        goto fetch_obj_is_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -42761,24 +42885,31 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER
        void **cache_slot = NULL;
 
        SAVE_OPLINE();
-       container = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
+       container = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
 
        if (IS_CV == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
+       offset = _get_zval_ptr_cv_undef(opline->op2.var EXECUTE_DATA_CC);
 
        if (IS_CV == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -42826,6 +42957,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER
                                        }
                                }
                        }
+               } else if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -42911,18 +43044,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLE
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset  = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
+       offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
 
        if (IS_CV == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_is_no_object;
+               do {
+                       if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
                        }
-               } else {
                        goto fetch_obj_is_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -46458,7 +46592,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HAN
        void **cache_slot = NULL;
 
        SAVE_OPLINE();
-       container = _get_zval_ptr_cv_BP_VAR_R(opline->op1.var EXECUTE_DATA_CC);
+       container = _get_zval_ptr_cv_undef(opline->op1.var EXECUTE_DATA_CC);
 
        if (IS_CV == IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) {
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
@@ -46468,14 +46602,21 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HAN
 
        if (IS_CV == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_r_no_object;
+           do {
+                       if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
+                       }
+                       if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(container) == IS_UNDEF)) {
+                               GET_OP1_UNDEF_CV(container, BP_VAR_R);
+                       }
+                       if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                               GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                        }
-               } else {
                        goto fetch_obj_r_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -46523,6 +46664,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HAN
                                        }
                                }
                        }
+               } else if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_INFO_P(offset) == IS_UNDEF)) {
+                       GET_OP2_UNDEF_CV(offset, BP_VAR_R);
                }
 
                if (UNEXPECTED(zobj->handlers->read_property == NULL)) {
@@ -46609,18 +46752,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_HA
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset  = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
+       offset = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
 
        if (IS_CV == IS_CONST ||
            (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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_is_no_object;
+               do {
+                       if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
                        }
-               } else {
                        goto fetch_obj_is_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -49855,18 +49999,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset  = RT_CONSTANT(opline, opline->op2);
+       offset = RT_CONSTANT(opline, opline->op2);
 
        if ((IS_TMP_VAR|IS_VAR) == IS_CONST ||
            ((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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_is_no_object;
+               do {
+                       if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
                        }
-               } else {
                        goto fetch_obj_is_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -52240,18 +52385,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_HA
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset  = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
+       offset = _get_zval_ptr_cv_BP_VAR_R(opline->op2.var EXECUTE_DATA_CC);
 
        if ((IS_TMP_VAR|IS_VAR) == IS_CONST ||
            ((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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_is_no_object;
+               do {
+                       if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
                        }
-               } else {
                        goto fetch_obj_is_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */
@@ -53598,18 +53744,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVA
                ZEND_VM_TAIL_CALL(zend_this_not_in_object_context_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU));
        }
 
-       offset  = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
+       offset = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC);
 
        if ((IS_TMP_VAR|IS_VAR) == IS_CONST ||
            ((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);
-                       if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) {
-                               goto fetch_obj_is_no_object;
+               do {
+                       if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) {
+                               container = Z_REFVAL_P(container);
+                               if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
+                                       break;
+                               }
                        }
-               } else {
                        goto fetch_obj_is_no_object;
-               }
+               } while (0);
        }
 
        /* here we are sure we are dealing with an object */