diff options
| author | BernardXiong <[email protected]> | 2019-03-26 13:49:18 +0000 |
|---|---|---|
| committer | BernardXiong <[email protected]> | 2019-03-26 13:49:18 +0000 |
| commit | 50a97669cf62b443aec80ac2a88297db817bf105 (patch) | |
| tree | cd37026f214d4f273c164df310e7fd5bd85bc897 /src | |
| parent | b1a98ebe4621d6217da373078c34a4790fabe1c9 (diff) | |
[Kernel] Add object re-initialization check.
Diffstat (limited to 'src')
| -rw-r--r-- | src/object.c | 3 |
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; |
