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 82d4b0852ecb1cda828a072be919d846eb326f77
parent 0f31c1e97fa86ca4c82ce726852621380ddc8c46
Author: Michael Forney <mforney@mforney.org>
Date:   Thu, 21 Feb 2019 00:58:04 -0800

Fix decay on qualified array types

Diffstat:
Mexpr.c | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/expr.c b/expr.c @@ -54,7 +54,6 @@ static struct expression *mkunaryexpr(enum tokenkind, struct expression *); static struct expression * decay(struct expression *e) { - struct expression *old = e; struct type *t; enum typequalifier tq = QUALNONE; @@ -62,12 +61,12 @@ decay(struct expression *e) t = typeunqual(e->type, &tq); switch (t->kind) { case TYPEARRAY: - e = mkunaryexpr(TBAND, old); - e->type = mkqualifiedtype(mkpointertype(old->type->base), tq); + e = mkunaryexpr(TBAND, e); + e->type = mkqualifiedtype(mkpointertype(t->base), tq); e->flags |= EXPRFLAG_DECAYED; break; case TYPEFUNC: - e = mkunaryexpr(TBAND, old); + e = mkunaryexpr(TBAND, e); e->flags |= EXPRFLAG_DECAYED; break; }