]> 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:08:11 +0000 (14:08 +0000)
committerDmitry Stogov <dmitry@php.net>
Sat, 26 Jul 2008 14:08:11 +0000 (14:08 +0000)
Zend/zend_execute.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 614deb171efba1673ce0544c87f2954905a751d0..c4b10c221d2a7a22499fd3c52f5e0b6054b52ab9 100644 (file)
@@ -594,6 +594,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 2a758227eaed787e4f588616235e8fc044940941..a294a02b359f3bd20b89d06b4f7eb8cd95939315 100644 (file)
@@ -3479,7 +3479,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 {
@@ -3936,9 +3940,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 2eb2522abd7e4537c0f59778d6093a96ddf7bf93..6cb693ecedd070a5f4f3be082d4d9b29ae9903e7 100644 (file)
@@ -10688,7 +10688,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 {
@@ -10777,9 +10781,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);
@@ -12457,7 +12471,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 {
@@ -12546,9 +12564,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);
@@ -14273,7 +14301,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 {
@@ -14362,9 +14394,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);
@@ -16702,7 +16744,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 {
@@ -16791,9 +16837,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);
@@ -17875,7 +17931,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 {
@@ -17963,9 +18023,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);
@@ -18894,7 +18964,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 {
@@ -18982,9 +19056,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);
@@ -19913,7 +19997,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 {
@@ -20001,9 +20089,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);
@@ -21202,7 +21300,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 {
@@ -21290,9 +21392,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);
@@ -24133,7 +24245,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 {
@@ -24221,9 +24337,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);
@@ -25783,7 +25909,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 {
@@ -25871,9 +26001,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);
@@ -27479,7 +27619,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 {
@@ -27567,9 +27711,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);
@@ -29679,7 +29833,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 {
@@ -29767,9 +29925,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);