cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit 87200240f61e16f289cdabd678a6950386998ced
parent ba938ae247c78838a942980dfcf9e6618a6ce610
Author: Michael Forney <mforney@mforney.org>
Date:   Sun,  3 Mar 2019 20:52:46 -0800

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.

Diffstat:
Mqbe.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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)