From 87200240f61e16f289cdabd678a6950386998ced Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sun, 3 Mar 2019 20:52:46 -0800 Subject: Fix emittype for qualified nested struct We don't have to strip qualifiers off of array types since array types can only be qualified when used in a parameter declaration before adjustment. --- qbe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qbe.c b/qbe.c index d69f49e..8daf023 100644 --- a/qbe.c +++ b/qbe.c @@ -1012,7 +1012,7 @@ emittype(struct type *t) for (m = t->structunion.members; m; m = m->next) { for (sub = m->type; sub->kind == TYPEARRAY; sub = sub->base) ; - emittype(sub); + emittype(typeunqual(sub, NULL)); } fputs("type :", stdout); emitname(&t->repr->abi); @@ -1022,7 +1022,7 @@ emittype(struct type *t) fputs("{ ", stdout); for (i = 1, sub = m->type; sub->kind == TYPEARRAY; sub = sub->base) i *= sub->array.length; - emitrepr(sub->repr, true, true); + emitrepr(typeunqual(sub, NULL)->repr, true, true); if (i > 1) printf(" %" PRIu64, i); if (t->kind == TYPEUNION) -- cgit v1.2.3