qapi: Tighten checking of unions
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 <eblake@redhat.com> Reviewed-by:
Markus Armbruster <armbru@redhat.com> Signed-off-by:
Markus Armbruster <armbru@redhat.com>
Showing
- scripts/qapi-types.py 2 additions, 11 deletionsscripts/qapi-types.py
- scripts/qapi.py 72 additions, 17 deletionsscripts/qapi.py
- tests/qapi-schema/alternate-array.err 1 addition, 0 deletionstests/qapi-schema/alternate-array.err
- tests/qapi-schema/alternate-array.exit 1 addition, 1 deletiontests/qapi-schema/alternate-array.exit
- tests/qapi-schema/alternate-array.json 1 addition, 1 deletiontests/qapi-schema/alternate-array.json
- tests/qapi-schema/alternate-array.out 0 additions, 4 deletionstests/qapi-schema/alternate-array.out
- tests/qapi-schema/alternate-base.err 1 addition, 0 deletionstests/qapi-schema/alternate-base.err
- tests/qapi-schema/alternate-base.exit 1 addition, 1 deletiontests/qapi-schema/alternate-base.exit
- tests/qapi-schema/alternate-base.json 1 addition, 1 deletiontests/qapi-schema/alternate-base.json
- tests/qapi-schema/alternate-base.out 0 additions, 4 deletionstests/qapi-schema/alternate-base.out
- tests/qapi-schema/alternate-clash.err 1 addition, 0 deletionstests/qapi-schema/alternate-clash.err
- tests/qapi-schema/alternate-clash.exit 1 addition, 1 deletiontests/qapi-schema/alternate-clash.exit
- tests/qapi-schema/alternate-clash.json 1 addition, 1 deletiontests/qapi-schema/alternate-clash.json
- tests/qapi-schema/alternate-clash.out 0 additions, 3 deletionstests/qapi-schema/alternate-clash.out
- tests/qapi-schema/alternate-conflict-dict.err 1 addition, 0 deletionstests/qapi-schema/alternate-conflict-dict.err
- tests/qapi-schema/alternate-conflict-dict.exit 1 addition, 1 deletiontests/qapi-schema/alternate-conflict-dict.exit
- tests/qapi-schema/alternate-conflict-dict.json 1 addition, 1 deletiontests/qapi-schema/alternate-conflict-dict.json
- tests/qapi-schema/alternate-conflict-dict.out 0 additions, 6 deletionstests/qapi-schema/alternate-conflict-dict.out
- tests/qapi-schema/alternate-conflict-string.err 1 addition, 0 deletionstests/qapi-schema/alternate-conflict-string.err
- tests/qapi-schema/alternate-conflict-string.exit 1 addition, 1 deletiontests/qapi-schema/alternate-conflict-string.exit
Loading
Please register or sign in to comment