mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-28 21:03:54 -06:00
qapi: Assert incomplete object occurs only in dealloc visitor
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20200424084338.26803-7-armbru@redhat.com>
This commit is contained in:
parent
554d6586ae
commit
8e08bf4ea2
4 changed files with 16 additions and 0 deletions
|
@ -189,6 +189,8 @@ void visit_type_%(c_name)s(Visitor *v, const char *name, %(c_name)s **obj, Error
|
|||
goto out;
|
||||
}
|
||||
if (!*obj) {
|
||||
/* incomplete */
|
||||
assert(visit_is_dealloc(v));
|
||||
goto out_obj;
|
||||
}
|
||||
switch ((*obj)->type) {
|
||||
|
@ -260,6 +262,8 @@ void visit_type_%(c_name)s(Visitor *v, const char *name, %(c_name)s **obj, Error
|
|||
goto out;
|
||||
}
|
||||
if (!*obj) {
|
||||
/* incomplete */
|
||||
assert(visit_is_dealloc(v));
|
||||
goto out_obj;
|
||||
}
|
||||
visit_type_%(c_name)s_members(v, *obj, &err);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue