mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 14:53:54 -06:00
qapi-visit: Kill unused visit_end_union()
The generated code can call visit_end_union() without having called
visit_start_union(). Example:
if (!*obj) {
goto out_obj;
}
visit_type_CpuInfoBase_fields(v, (CpuInfoBase **)obj, &err);
if (err) {
goto out_obj; // if we go from here...
}
if (!visit_start_union(v, !!(*obj)->u.data, &err) || err) {
goto out_obj;
}
switch ((*obj)->arch) {
[...]
}
out_obj:
// ... then *obj is true, and ...
error_propagate(errp, err);
err = NULL;
if (*obj) {
// we end up here
visit_end_union(v, !!(*obj)->u.data, &err);
}
error_propagate(errp, err);
Harmless only because no visitor implements end_union(). Clean it up
anyway, by deleting the function as useless.
Messed up since we have visit_end_union (commit cee2ded
).
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1453902888-20457-3-git-send-email-armbru@redhat.com>
[expand scope of patch to delete rather than repair]
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1454075341-13658-13-git-send-email-eblake@redhat.com>
This commit is contained in:
parent
92b09babc1
commit
7c91aabd89
4 changed files with 1 additions and 14 deletions
|
@ -58,7 +58,6 @@ struct Visitor
|
|||
/* visit_type_size() falls back to (*type_uint64)() if type_size is unset */
|
||||
void (*type_size)(Visitor *v, uint64_t *obj, const char *name, Error **errp);
|
||||
bool (*start_union)(Visitor *v, bool data_present, Error **errp);
|
||||
void (*end_union)(Visitor *v, bool data_present, Error **errp);
|
||||
};
|
||||
|
||||
void input_type_enum(Visitor *v, int *obj, const char * const strings[],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue