Commit b1bc31f4 authored by Markus Armbruster's avatar Markus Armbruster
Browse files

qapi: Fix to .check() empty structs just once



QAPISchemaObjectType.check() does nothing for types that have been
checked already.  Except the "has been checked" predicate is broken
for empty types: self.members is [] then, which isn't true.  The bug
is harmless, but fix it anyway: use self.member is not None instead.

Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
Message-Id: <20190914153506.2151-18-armbru@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
parent e31fe126
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1406,7 +1406,7 @@ class QAPISchemaObjectType(QAPISchemaType):
        if self.members is False:               # check for cycles
            raise QAPISemError(self.info,
                               "Object %s contains itself" % self.name)
        if self.members:
        if self.members is not None:            # already checked
            return
        self.members = False                    # mark as being checked
        seen = OrderedDict()