harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit ebf77236b94e149f3afd161f146f77b2247b1126
parent 90985fa53892ae81271c594da33be9dca9da4885
Author: Drew DeVault <sir@cmpwn.com>
Date:   Tue, 10 Aug 2021 09:54:53 +0200

gen: implement non-c_compat struct/union types

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Msrc/qtype.c | 6+++++-
Mtests/configure | 1+
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/qtype.c b/src/qtype.c @@ -100,7 +100,11 @@ aggregate_lookup(struct gen_context *ctx, const struct type *type) break; case STORAGE_STRUCT: case STORAGE_UNION: - assert(type->struct_union.c_compat); // TODO + if (!type->struct_union.c_compat) { + field->type = NULL; + field->count = type->size; + break; + } size_t n = 0; for (struct struct_field *tfield = type->struct_union.fields; tfield; tfield = tfield->next) { diff --git a/tests/configure b/tests/configure @@ -50,6 +50,7 @@ EOF 09-funcs \ 10-binarithms \ 11-globals \ + 13-tagged \ 14-switch \ 17-alloc \ 20-if \