From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34006) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9U0X-0000La-55 for qemu-devel@nongnu.org; Thu, 17 Dec 2015 03:33:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a9U0W-000180-0I for qemu-devel@nongnu.org; Thu, 17 Dec 2015 03:33:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a9U0V-00017W-Rk for qemu-devel@nongnu.org; Thu, 17 Dec 2015 03:33:51 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 7EF70C7854 for ; Thu, 17 Dec 2015 08:33:51 +0000 (UTC) From: Markus Armbruster Date: Thu, 17 Dec 2015 09:33:12 +0100 Message-Id: <1450341225-2735-8-git-send-email-armbru@redhat.com> In-Reply-To: <1450341225-2735-1-git-send-email-armbru@redhat.com> References: <1450341225-2735-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PULL 07/40] qapi: Fix up commit 7618b91's clash sanity checking change List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 Message-Id: <1446559499-26984-4-git-send-email-armbru@redhat.com> [change TABs in commit message to space] Signed-off-by: Eric Blake Message-Id: <1447836791-369-8-git-send-email-eblake@redhat.com> --- scripts/qapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.4.3