diff --git a/core/object.c b/core/object.c index 20e5cca..070b388 100644 --- a/core/object.c +++ b/core/object.c @@ -2,6 +2,7 @@ #include "type.h" +#include #include #include #include @@ -98,6 +99,8 @@ void *b_object_get_private(const struct _b_object *object, b_type type) return NULL; } + assert(object->obj_magic == B_OBJECT_MAGIC); + if (b_type_id_compare(&object->obj_type->r_info->t_id, type) == 0) { return (char *)object + object->obj_main_priv_offset; } @@ -117,6 +120,8 @@ void *b_object_get_protected(const struct _b_object *object, b_type type) return NULL; } + assert(object->obj_magic == B_OBJECT_MAGIC); + struct b_type_component *comp = b_type_get_component(&object->obj_type->r_components, type); if (!comp) { @@ -132,6 +137,8 @@ void *b_object_get_interface(const struct _b_object *object, b_type type) return NULL; } + assert(object->obj_magic == B_OBJECT_MAGIC); + return b_class_get_interface(object->obj_type->r_class, type); } @@ -143,6 +150,8 @@ enum b_status b_object_get_data( return B_ERR_INVALID_ARGUMENT; } + assert(object->obj_magic == B_OBJECT_MAGIC); + struct b_type_component *comp = b_type_get_component(&object->obj_type->r_components, type); if (!comp) {