harec

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

commit 439ef102ec73b1f8415ebc1e55e5dffc903081c1
parent 934349a5b9b12e914f422b23af207bb6c70a88c2
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri, 13 Aug 2021 16:18:22 +0200

aggregate_lookup: fix inverted special case

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

Diffstat:
Msrc/qtype.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qtype.c b/src/qtype.c @@ -80,7 +80,7 @@ aggregate_lookup(struct gen_context *ctx, const struct type *type) struct qbe_field *field = &def->type.fields; switch (type->storage) { case STORAGE_ARRAY: - if (type->array.length != SIZE_UNDEFINED) { + if (type->array.length == SIZE_UNDEFINED) { return &qbe_long; // Special case } field->count = type->array.length; @@ -184,8 +184,8 @@ aggregate_lookup(struct gen_context *ctx, const struct type *type) return &def->type; } -const struct qbe_type *qtype_lookup( - struct gen_context *ctx, +const struct qbe_type * +qtype_lookup(struct gen_context *ctx, const struct type *type, bool xtype) { switch (type->storage) {