Skip to content
Snippets Groups Projects
  • Eric Blake's avatar
    44bd1276
    qapi: Tighten checking of unions · 44bd1276
    Eric Blake authored
    
    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: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    44bd1276
    History
    qapi: Tighten checking of unions
    Eric Blake authored
    
    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: default avatarEric Blake <eblake@redhat.com>
    Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>