mirror of https://gitee.com/openkylin/qemu.git
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: Markus Armbruster <armbru@redhat.com> Message-Id: <20190914153506.2151-18-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
e31fe1266c
commit
b1bc31f4b7
|
@ -1406,7 +1406,7 @@ def check(self, schema):
|
|||
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()
|
||||
|
|
Loading…
Reference in New Issue