[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v6 11/36] qapi: Tighten checking of unions
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v6 11/36] qapi: Tighten checking of unions |
Date: |
Mon, 27 Apr 2015 20:15:05 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Eric Blake <address@hidden> writes:
> Previous commits demonstrated that the generator had several
> flaws with less-than-perfect unions:
> - a simple union that listed the same branch twice (or two variant
> names that map to the same C enumerator, including the implicit
> MAX sentinel) ended up generating invalid C code
> - an anonymous union that listed two branches with the same qtype
> ended up generating invalid C code
> - the generator crashed on anonymous union attempts to use an
> array type
> - the generator was silently ignoring a base type for anonymous
> unions
> - the generator allowed unknown types or nested anonymous unions
> as a branch in an anonymous union
>
> Signed-off-by: Eric Blake <address@hidden>
[...]
> diff --git a/tests/qapi-schema/alternate-array.json
> b/tests/qapi-schema/alternate-array.json
> index c2965cf..77970d9 100644
> --- a/tests/qapi-schema/alternate-array.json
> +++ b/tests/qapi-schema/alternate-array.json
> @@ -1,4 +1,4 @@
> -# FIXME: we do not support array branches of anonymous unions yet
> +# we do not support array branches of anonymous unions yet
> # TODO: should we support this?
> { 'type': 'One',
> 'data': { 'name': 'str' } }
FIXME added in PATCH 08, demoted to plain comment now. Any particular
reason for the churn?
[...]
Regardless,
Reviewed-by: Markus Armbruster <address@hidden>
- Re: [Qemu-devel] [PATCH v6 10/36] qapi: Forbid base without discriminator in unions, (continued)
- [Qemu-devel] [PATCH v6 02/36] qapi: Document type-safety considerations, Eric Blake, 2015/04/05
- [Qemu-devel] [PATCH v6 15/36] qapi: Document new 'alternate' meta-type, Eric Blake, 2015/04/05
- [Qemu-devel] [PATCH v6 13/36] qapi: Segregate anonymous unions into alternates in generator, Eric Blake, 2015/04/05
- [Qemu-devel] [PATCH v6 14/36] qapi: Rename anonymous union type in test, Eric Blake, 2015/04/05
- [Qemu-devel] [PATCH v6 11/36] qapi: Tighten checking of unions, Eric Blake, 2015/04/05
- Re: [Qemu-devel] [PATCH v6 11/36] qapi: Tighten checking of unions,
Markus Armbruster <=
- [Qemu-devel] [PATCH v6 21/36] qapi: Allow true, false and null in schema json, Eric Blake, 2015/04/05
- [Qemu-devel] [PATCH v6 17/36] qapi: Add some expr tests, Eric Blake, 2015/04/05
- [Qemu-devel] [PATCH v6 19/36] qapi: Add tests of redefined expressions, Eric Blake, 2015/04/05
- [Qemu-devel] [PATCH v6 22/36] qapi: Unify type bypass and add tests, Eric Blake, 2015/04/05
- [Qemu-devel] [PATCH v6 18/36] qapi: Better error messages for bad expressions, Eric Blake, 2015/04/05
- [Qemu-devel] [PATCH v6 16/36] qapi: Use 'alternate' to replace anonymous union, Eric Blake, 2015/04/05