scc

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

commit a142f2ed782fe618116e51495f9404740087f4a1
parent 2fe852042893ad264f303ed805ae09be383f5dd7
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu,  7 Jan 2016 21:22:52 +0100

Convert pcompare() to use new fields of type

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

diff --git a/cc1/expr.c b/cc1/expr.c @@ -288,11 +288,16 @@ convert(Node *np, Type *newtp, char iscast) return castcode(np, newtp); } +#define XCHG(lp, rp, np) (np = lp, lp = rp, rp = np) + static Node * parithmetic(char op, Node *lp, Node *rp) { Type *tp; - Node *size; + Node *size, *np; + + if (lp->type->op != PTR) + XCHG(lp, rp, np); tp = lp->type; size = sizeofnode(tp->type);