summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBernardXiong <[email protected]>2019-03-26 13:49:18 +0000
committerBernardXiong <[email protected]>2019-03-26 13:49:18 +0000
commit50a97669cf62b443aec80ac2a88297db817bf105 (patch)
treecd37026f214d4f273c164df310e7fd5bd85bc897 /src
parentb1a98ebe4621d6217da373078c34a4790fabe1c9 (diff)
[Kernel] Add object re-initialization check.
Diffstat (limited to 'src')
-rw-r--r--src/object.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/object.c b/src/object.c
index 70b9a5c04e..050bb17757 100644
--- a/src/object.c
+++ b/src/object.c
@@ -251,6 +251,9 @@ void rt_object_init(struct rt_object *object,
/* initialize object's parameters */
+ /* check object type to avoid re-initialization */
+ RT_ASSERT(object->type != (type | RT_Object_Class_Static));
+
/* set object type to static */
object->type = type | RT_Object_Class_Static;