diff options
Diffstat (limited to 'scripts/qapi-visit.py')
-rw-r--r-- | scripts/qapi-visit.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py index 0b9e298bc4..96f2491c16 100644 --- a/scripts/qapi-visit.py +++ b/scripts/qapi-visit.py @@ -47,9 +47,11 @@ void visit_type_%(c_name)s_members(Visitor *v, %(c_name)s *obj, Error **errp) if base: ret += mcgen(''' visit_type_%(c_type)s_members(v, (%(c_type)s *)obj, &err); + if (err) { + goto out; + } ''', c_type=base.c_name()) - ret += gen_err_check() for memb in members: if memb.optional: @@ -60,10 +62,12 @@ void visit_type_%(c_name)s_members(Visitor *v, %(c_name)s *obj, Error **errp) push_indent() ret += mcgen(''' visit_type_%(c_type)s(v, "%(name)s", &obj->%(c_name)s, &err); + if (err) { + goto out; + } ''', c_type=memb.type.c_name(), name=memb.name, c_name=c_name(memb.name)) - ret += gen_err_check() if memb.optional: pop_indent() ret += mcgen(''' |