qom: Fix object_initialize_with_type() assertion
PATCH 1/1 qom: Fix object_initialize_with_type() assertion
Assert the object is at least sizeof(Object), not sizeof(ObjectClass).
Signed-off-by Andreas Färber <[email protected]>
--- qom/object.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
qom/object.c +1 -1
@@ -262,7 +262,7 @@ void object_initialize_with_type(void *data, TypeImpl *type)Object *obj = data;g_assert (type !=NULL ); -g_assert (type->instance_size >=sizeof (ObjectClass)); +g_assert (type->instance_size >=sizeof (Object));type_class_init (type);g_assert (type->abstract == false);
Signature · 1 line
1.7.7
Quoted 12 lines · Andreas Färber
Assert the object is at least sizeof(Object), not sizeof(ObjectClass).
Signed-off-by Andreas Färber <[email protected]>--- qom/object.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)qom/object.c +0
-0
qom/object.c void object_initialize_with_type(void *data, TypeImpl *type) · line 268
Quoted 8 lines
qom/object.c +1
-1@@ -262,7 +262,7 @@ void object_initialize_with_type(void *data, TypeImpl *type)Object *obj = data;g_assert (type !=NULL ); -g_assert (type->instance_size >=sizeof (ObjectClass)); +g_assert (type->instance_size >=sizeof (Object));type_class_init (type);g_assert (type->abstract == false);
Reviewed-by Paolo Bonzini <[email protected]>
Paolo
Anthony Liguori
AppliedQuoted 3 lines · Andreas Färber
Assert the object is at least sizeof(Object), not sizeof(ObjectClass).
Signed-off-by Andreas Färber<[email protected]>
Applied. Thanks.
Regards,
Anthony Liguori
Quoted 17 lines
--- qom/object.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)qom/object.c +1
-1@@ -262,7 +262,7 @@ void object_initialize_with_type(void *data, TypeImpl *type)Object *obj = data;g_assert (type !=NULL ); -g_assert (type->instance_size>=sizeof (ObjectClass)); +g_assert (type->instance_size>=sizeof (Object));type_class_init (type);g_assert (type->abstract == false);