commit a142f2ed782fe618116e51495f9404740087f4a1
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Thu Jan 7 21:22:52 2016 +0100
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Fri Jan 8 10:49:29 2016 +0100

    Convert pcompare() to use new fields of type

diff --git a/cc1/expr.c b/cc1/expr.c
index 8b7fa6e..175cd2d 100644
--- 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);

Reply via email to