mirror of
https://github.com/mii443/qemu.git
synced 2025-08-23 15:48:20 +00: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:
@ -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);
|
||||
|
Reference in New Issue
Block a user