From b32abbb2f563ca26c0f87e848d46e1001568b7f6 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 6 Aug 2021 14:05:10 +0200 Subject: qapi: Fix crash on redefinition with a different condition QAPISchema._make_implicit_object_type() asserts that when an implicit object type is used multiple times, @ifcond is the same for all uses. It will be for legitimate uses, i.e. simple union branch wrapper types. A comment explains this. The assertion fails when a command or event is redefined with a different condition. The redefinition is an error, but it's flagged only later. Fixing the assertion would complicate matters further. Not worthwhile, drop it instead. We really need to get rid of simple unions. Tweak test case redefined-event to cover redefinition with a different condition. Signed-off-by: Markus Armbruster Message-Id: <20210806120510.2367124-1-armbru@redhat.com> Reviewed-by: Eric Blake --- tests/qapi-schema/redefined-event.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/qapi-schema/redefined-event.json b/tests/qapi-schema/redefined-event.json index 7717e91c18..09eff18412 100644 --- a/tests/qapi-schema/redefined-event.json +++ b/tests/qapi-schema/redefined-event.json @@ -1,3 +1,3 @@ # we reject duplicate events { 'event': 'EVENT_A', 'data': { 'myint': 'int' } } -{ 'event': 'EVENT_A', 'data': { 'myint': 'int' } } +{ 'event': 'EVENT_A', 'data': { 'myint': 'int' }, 'if': 'defined(FOO)' } -- cgit v1.2.3