harec

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

commit 0c895cbde85a7d553c59c2e5b5be584a202d9736
parent ef58168ea800f0a74bea8d3f3889b79583d18137
Author: Drew DeVault <sir@cmpwn.com>
Date:   Thu,  5 Aug 2021 14:25:46 +0200

gen: add qtype for slice

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

Diffstat:
Msrc/qtype.c | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/qtype.c b/src/qtype.c @@ -49,6 +49,12 @@ aggregate_lookup(struct gen_context *ctx, const struct type *type) field->type = ctx->arch.ptr; field->count = 3; break; + case STORAGE_SLICE: + // XXX: This assertion does not hold for all architectures + assert(ctx->arch.ptr->stype == ctx->arch.sz->stype); + field->type = ctx->arch.ptr; + field->count = 3; + break; case STORAGE_STRUCT: case STORAGE_UNION: assert(type->struct_union.c_compat); // TODO @@ -89,9 +95,8 @@ aggregate_lookup(struct gen_context *ctx, const struct type *type) } } break; - case STORAGE_SLICE: case STORAGE_TAGGED: - assert(0); // TODO + break; case STORAGE_ENUM: case STORAGE_ALIAS: case STORAGE_CHAR: