scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 8fd6d549ca3d5dc3072327e31f85e2ef9b8de088
parent a142f2ed782fe618116e51495f9404740087f4a1
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu,  7 Jan 2016 21:32:44 +0100

Convert compare() to use the new fileds in Type

Diffstat:
Mcc1/expr.c | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/cc1/expr.c b/cc1/expr.c @@ -344,6 +344,9 @@ pcompare(char op, Node *lp, Node *rp) Node *np; int err = 0; + if (lp->type->integer) + XCHG(lp, rp, np); + if (rp->type->integer) { if (!cmpnode(rp, 0)) err = 1; @@ -366,8 +369,9 @@ compare(char op, Node *lp, Node *rp) lp = decay(lp); rp = decay(rp); + ltp = lp->type; - rtp = rtp->type; + rtp = rp->type; if (ltp->op == PTR || rtp->op == PTR) { return pcompare(op, rp, lp);