qapi: Catch and reject flat union branch of array type

Backports commit f9a1427361fe06ac67480d580412dc4ed6f5d03b from qemu
This commit is contained in:
Markus Armbruster 2018-02-19 15:48:10 -05:00 committed by Lioncash
parent 52e7d76d23
commit ed3da56d26
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -579,7 +579,7 @@ def check_union(expr, expr_info):
# Each value must name a known type; furthermore, in flat unions,
# branches must be a struct with no overlapping member names
check_type(expr_info, "Member '%s' of union '%s'" % (key, name),
value, allow_array=True, allow_metas=allow_metas)
value, allow_array=not base, allow_metas=allow_metas)
if base:
branch_struct = find_struct(value)
assert branch_struct