]> granicus.if.org Git - php/commitdiff
Fixed crashes and memory leak for objects with NULL write_property/has_property/unset...
authorDmitry Stogov <dmitry@php.net>
Sat, 26 Jul 2008 14:09:05 +0000 (14:09 +0000)
committerDmitry Stogov <dmitry@php.net>
Sat, 26 Jul 2008 14:09:05 +0000 (14:09 +0000)
Zend/zend_execute.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 8c509bb73543a934eac99da6cee07779e68280f5..7e5b94a0e52f8e19db423ddcdf48e15dd18add6e 100644 (file)
@@ -600,6 +600,11 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, zval
                                *retval = EG(uninitialized_zval_ptr);
                                PZVAL_LOCK(*retval);
                        }
+                       if (value_op->op_type == IS_TMP_VAR) {
+                               FREE_ZVAL(value);
+                       } else if (value_op->op_type == IS_CONST) {
+                               zval_ptr_dtor(&value);
+                       }
                        FREE_OP(free_value);
                        return;
                }
index d670342cc819cdf2bae6e0512c43116da57bdeb5..f0b3a2ae1d4b8d61141945241b8e03e92fce4998 100644 (file)
@@ -3608,7 +3608,11 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
                        if (IS_OP2_TMP_FREE()) {
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
-                       Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       if (Z_OBJ_HT_P(*container)->unset_property) {
+                               Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       } else {
+                               zend_error(E_NOTICE, "Trying to unset property of non-object");
+                       }
                        if (IS_OP2_TMP_FREE()) {
                                zval_ptr_dtor(&offset);
                        } else {
@@ -4097,9 +4101,19 @@ ZEND_VM_HELPER_EX(zend_isset_isempty_dim_prop_obj_handler, VAR|UNUSED|CV, CONST|
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
                        if (prop_dim) {
-                               result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_property) {
+                                       result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check property of non-object");
+                                       result = 0;
+                               }
                        } else {
-                               result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_dimension) {
+                                       result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check element of non-array");
+                                       result = 0;
+                               }
                        }
                        if (IS_OP2_TMP_FREE()) {
                                zval_ptr_dtor(&offset);
index f5c5e6673dc84dd2f5b4c124106ed14958210e14..3a53b8df788d323905697935ba7e4faf69e68a91 100644 (file)
@@ -11112,7 +11112,11 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
                        if (0) {
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
-                       Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       if (Z_OBJ_HT_P(*container)->unset_property) {
+                               Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       } else {
+                               zend_error(E_NOTICE, "Trying to unset property of non-object");
+                       }
                        if (0) {
                                zval_ptr_dtor(&offset);
                        } else {
@@ -11223,9 +11227,19 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CONST(
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
                        if (prop_dim) {
-                               result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_property) {
+                                       result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check property of non-object");
+                                       result = 0;
+                               }
                        } else {
-                               result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_dimension) {
+                                       result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check element of non-array");
+                                       result = 0;
+                               }
                        }
                        if (0) {
                                zval_ptr_dtor(&offset);
@@ -12940,7 +12954,11 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
                        if (1) {
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
-                       Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       if (Z_OBJ_HT_P(*container)->unset_property) {
+                               Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       } else {
+                               zend_error(E_NOTICE, "Trying to unset property of non-object");
+                       }
                        if (1) {
                                zval_ptr_dtor(&offset);
                        } else {
@@ -13051,9 +13069,19 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_TMP(in
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
                        if (prop_dim) {
-                               result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_property) {
+                                       result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check property of non-object");
+                                       result = 0;
+                               }
                        } else {
-                               result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_dimension) {
+                                       result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check element of non-array");
+                                       result = 0;
+                               }
                        }
                        if (1) {
                                zval_ptr_dtor(&offset);
@@ -14815,7 +14843,11 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
                        if (0) {
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
-                       Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       if (Z_OBJ_HT_P(*container)->unset_property) {
+                               Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       } else {
+                               zend_error(E_NOTICE, "Trying to unset property of non-object");
+                       }
                        if (0) {
                                zval_ptr_dtor(&offset);
                        } else {
@@ -14926,9 +14958,19 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_VAR(in
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
                        if (prop_dim) {
-                               result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_property) {
+                                       result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check property of non-object");
+                                       result = 0;
+                               }
                        } else {
-                               result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_dimension) {
+                                       result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check element of non-array");
+                                       result = 0;
+                               }
                        }
                        if (0) {
                                zval_ptr_dtor(&offset);
@@ -17306,7 +17348,11 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
                        if (0) {
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
-                       Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       if (Z_OBJ_HT_P(*container)->unset_property) {
+                               Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       } else {
+                               zend_error(E_NOTICE, "Trying to unset property of non-object");
+                       }
                        if (0) {
                                zval_ptr_dtor(&offset);
                        } else {
@@ -17417,9 +17463,19 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_VAR_CV(int
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
                        if (prop_dim) {
-                               result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_property) {
+                                       result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check property of non-object");
+                                       result = 0;
+                               }
                        } else {
-                               result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_dimension) {
+                                       result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check element of non-array");
+                                       result = 0;
+                               }
                        }
                        if (0) {
                                zval_ptr_dtor(&offset);
@@ -18531,7 +18587,11 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
                        if (0) {
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
-                       Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       if (Z_OBJ_HT_P(*container)->unset_property) {
+                               Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       } else {
+                               zend_error(E_NOTICE, "Trying to unset property of non-object");
+                       }
                        if (0) {
                                zval_ptr_dtor(&offset);
                        } else {
@@ -18641,9 +18701,19 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CON
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
                        if (prop_dim) {
-                               result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_property) {
+                                       result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check property of non-object");
+                                       result = 0;
+                               }
                        } else {
-                               result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_dimension) {
+                                       result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check element of non-array");
+                                       result = 0;
+                               }
                        }
                        if (0) {
                                zval_ptr_dtor(&offset);
@@ -19602,7 +19672,11 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
                        if (1) {
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
-                       Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       if (Z_OBJ_HT_P(*container)->unset_property) {
+                               Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       } else {
+                               zend_error(E_NOTICE, "Trying to unset property of non-object");
+                       }
                        if (1) {
                                zval_ptr_dtor(&offset);
                        } else {
@@ -19712,9 +19786,19 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_TMP
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
                        if (prop_dim) {
-                               result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_property) {
+                                       result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check property of non-object");
+                                       result = 0;
+                               }
                        } else {
-                               result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_dimension) {
+                                       result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check element of non-array");
+                                       result = 0;
+                               }
                        }
                        if (1) {
                                zval_ptr_dtor(&offset);
@@ -20673,7 +20757,11 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
                        if (0) {
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
-                       Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       if (Z_OBJ_HT_P(*container)->unset_property) {
+                               Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       } else {
+                               zend_error(E_NOTICE, "Trying to unset property of non-object");
+                       }
                        if (0) {
                                zval_ptr_dtor(&offset);
                        } else {
@@ -20783,9 +20871,19 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_VAR
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
                        if (prop_dim) {
-                               result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_property) {
+                                       result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check property of non-object");
+                                       result = 0;
+                               }
                        } else {
-                               result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_dimension) {
+                                       result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check element of non-array");
+                                       result = 0;
+                               }
                        }
                        if (0) {
                                zval_ptr_dtor(&offset);
@@ -22013,7 +22111,11 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
                        if (0) {
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
-                       Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       if (Z_OBJ_HT_P(*container)->unset_property) {
+                               Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       } else {
+                               zend_error(E_NOTICE, "Trying to unset property of non-object");
+                       }
                        if (0) {
                                zval_ptr_dtor(&offset);
                        } else {
@@ -22123,9 +22225,19 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_UNUSED_CV(
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
                        if (prop_dim) {
-                               result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_property) {
+                                       result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check property of non-object");
+                                       result = 0;
+                               }
                        } else {
-                               result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_dimension) {
+                                       result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check element of non-array");
+                                       result = 0;
+                               }
                        }
                        if (0) {
                                zval_ptr_dtor(&offset);
@@ -25141,7 +25253,11 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
                        if (0) {
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
-                       Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       if (Z_OBJ_HT_P(*container)->unset_property) {
+                               Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       } else {
+                               zend_error(E_NOTICE, "Trying to unset property of non-object");
+                       }
                        if (0) {
                                zval_ptr_dtor(&offset);
                        } else {
@@ -25251,9 +25367,19 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CONST(i
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
                        if (prop_dim) {
-                               result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_property) {
+                                       result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check property of non-object");
+                                       result = 0;
+                               }
                        } else {
-                               result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_dimension) {
+                                       result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check element of non-array");
+                                       result = 0;
+                               }
                        }
                        if (0) {
                                zval_ptr_dtor(&offset);
@@ -26847,7 +26973,11 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
                        if (1) {
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
-                       Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       if (Z_OBJ_HT_P(*container)->unset_property) {
+                               Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       } else {
+                               zend_error(E_NOTICE, "Trying to unset property of non-object");
+                       }
                        if (1) {
                                zval_ptr_dtor(&offset);
                        } else {
@@ -26957,9 +27087,19 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_TMP(int
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
                        if (prop_dim) {
-                               result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_property) {
+                                       result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check property of non-object");
+                                       result = 0;
+                               }
                        } else {
-                               result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_dimension) {
+                                       result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check element of non-array");
+                                       result = 0;
+                               }
                        }
                        if (1) {
                                zval_ptr_dtor(&offset);
@@ -28599,7 +28739,11 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_HANDLER
                        if (0) {
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
-                       Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       if (Z_OBJ_HT_P(*container)->unset_property) {
+                               Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       } else {
+                               zend_error(E_NOTICE, "Trying to unset property of non-object");
+                       }
                        if (0) {
                                zval_ptr_dtor(&offset);
                        } else {
@@ -28709,9 +28853,19 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_VAR(int
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
                        if (prop_dim) {
-                               result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_property) {
+                                       result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check property of non-object");
+                                       result = 0;
+                               }
                        } else {
-                               result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_dimension) {
+                                       result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check element of non-array");
+                                       result = 0;
+                               }
                        }
                        if (0) {
                                zval_ptr_dtor(&offset);
@@ -30855,7 +31009,11 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(ZEND_OPCODE_HANDLER_
                        if (0) {
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
-                       Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       if (Z_OBJ_HT_P(*container)->unset_property) {
+                               Z_OBJ_HT_P(*container)->unset_property(*container, offset TSRMLS_CC);
+                       } else {
+                               zend_error(E_NOTICE, "Trying to unset property of non-object");
+                       }
                        if (0) {
                                zval_ptr_dtor(&offset);
                        } else {
@@ -30965,9 +31123,19 @@ static int ZEND_FASTCALL zend_isset_isempty_dim_prop_obj_handler_SPEC_CV_CV(int
                                MAKE_REAL_ZVAL_PTR(offset);
                        }
                        if (prop_dim) {
-                               result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_property) {
+                                       result = Z_OBJ_HT_P(*container)->has_property(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check property of non-object");
+                                       result = 0;
+                               }
                        } else {
-                               result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               if (Z_OBJ_HT_P(*container)->has_dimension) {
+                                       result = Z_OBJ_HT_P(*container)->has_dimension(*container, offset, (opline->extended_value == ZEND_ISEMPTY) TSRMLS_CC);
+                               } else {
+                                       zend_error(E_NOTICE, "Trying to check element of non-array");
+                                       result = 0;
+                               }
                        }
                        if (0) {
                                zval_ptr_dtor(&offset);