aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi.py
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-11-18 01:52:42 -0700
committerMarkus Armbruster <armbru@redhat.com>2015-12-17 08:21:26 +0100
commit08683353fc46b5d462199c9e8cff6f6c67f20f65 (patch)
treebe2f0a4e09aa247ab2a8a23ffa0d376d8abd1537 /scripts/qapi.py
parentcdc5fa37eda2896d2b08f9215c963256eb859d3b (diff)
downloadqemu-08683353fc46b5d462199c9e8cff6f6c67f20f65.zip
qemu-08683353fc46b5d462199c9e8cff6f6c67f20f65.tar.gz
qemu-08683353fc46b5d462199c9e8cff6f6c67f20f65.tar.bz2
qapi: Fix up commit 7618b91's clash sanity checking change
This hunk @@ -964,6 +965,7 @@ class QAPISchemaObjectType(QAPISchemaType): members = [] seen = {} for m in members: + assert c_name(m.name) not in seen seen[m.name] = m for m in self.local_members: m.check(schema, members, seen) is plainly broken. Asserting the members inherited from base don't clash is somewhat redundant, because self.base.check() just checked that. But it doesn't hurt. The idea to use c_name(m.name) instead of m.name for collision checking is sound, because we need to catch clashes between the m.name and between the c_name(m.name), and when two m.name clash, then their c_name() also clash. However, using c_name(m.name) instead of m.name in one of several places doesn't work. See the very next line. Keep the assertion, but drop the c_name() for now. A future commit will bring it back. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1446559499-26984-4-git-send-email-armbru@redhat.com> [change TABs in commit message to space] Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1447836791-369-8-git-send-email-eblake@redhat.com>
Diffstat (limited to 'scripts/qapi.py')
-rw-r--r--scripts/qapi.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/qapi.py b/scripts/qapi.py
index 0bf8235..86d2adc 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -987,7 +987,7 @@ class QAPISchemaObjectType(QAPISchemaType):
members = []
seen = {}
for m in members:
- assert c_name(m.name) not in seen
+ assert m.name not in seen
seen[m.name] = m
for m in self.local_members:
m.check(schema)