summaryrefslogtreecommitdiffstats
path: root/scripts/qapi-visit.py
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-01-29 06:48:48 -0700
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:31:49 -0600
commit01b3c8e954e7dd2e157ed8072662362556a039bd (patch)
treefe2f473fcbf239aae5da356413b629c3b372ce76 /scripts/qapi-visit.py
parentd064d011ea61090a838dd23356d840f293a752a2 (diff)
downloadhqemu-01b3c8e954e7dd2e157ed8072662362556a039bd.zip
hqemu-01b3c8e954e7dd2e157ed8072662362556a039bd.tar.gz
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>
Diffstat (limited to 'scripts/qapi-visit.py')
-rw-r--r--scripts/qapi-visit.py5
1 files changed, 0 insertions, 5 deletions
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index ec16e36..f98bb5f 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -320,11 +320,6 @@ void visit_type_%(c_name)s(Visitor *v, %(c_name)s **obj, const char *name, Error
out_obj:
error_propagate(errp, err);
err = NULL;
- if (*obj) {
- visit_end_union(v, !!(*obj)->u.data, &err);
- }
- error_propagate(errp, err);
- err = NULL;
visit_end_struct(v, &err);
out:
error_propagate(errp, err);
OpenPOWER on IntegriCloud