[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/26] object: add extra sanity checks
From: |
Marc-André Lureau |
Subject: |
[PATCH 01/26] object: add extra sanity checks |
Date: |
Fri, 10 Jan 2020 19:30:14 +0400 |
Type system checked that children class_size >= parent class_size, but
not instances. Fix that.
Signed-off-by: Marc-André Lureau <address@hidden>
---
qom/object.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/qom/object.c b/qom/object.c
index 0d971ca897..8453e4ac91 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -303,6 +303,7 @@ static void type_initialize(TypeImpl *ti)
int i;
g_assert(parent->class_size <= ti->class_size);
+ g_assert(parent->instance_size <= ti->instance_size);
memcpy(ti->class, parent->class, parent->class_size);
ti->class->interfaces = NULL;
ti->class->properties = g_hash_table_new_full(
--
2.25.0.rc1.20.g2443f3f80d.dirty
- [PATCH 00/26] Various qom & qdev enhancements, Marc-André Lureau, 2020/01/10
- [PATCH 01/26] object: add extra sanity checks,
Marc-André Lureau <=
- [PATCH 02/26] qdev: remove duplicated qdev_property_add_static() doc, Marc-André Lureau, 2020/01/10
- [PATCH 03/26] qdev: remove extraneous error, Marc-André Lureau, 2020/01/10
- [PATCH 04/26] qdev: move helper function to monitor/misc, Marc-André Lureau, 2020/01/10
- [PATCH 05/26] object: avoid extra class property key duplication, Marc-André Lureau, 2020/01/10
- [PATCH 06/26] object: add class property initializer, Marc-André Lureau, 2020/01/10
- [PATCH 07/26] object: add object_property_get_defaut(), Marc-André Lureau, 2020/01/10
- [PATCH 08/26] object: make object_class_property_add* return property, Marc-André Lureau, 2020/01/10
- [PATCH 09/26] qstring: add qstring_free(), Marc-André Lureau, 2020/01/10