Fix minor type width stuff in lib/ccom, makes offsets signed in assembly output
authorNick Downing <downing.nick@gmail.com>
Fri, 10 Feb 2017 13:05:38 +0000 (00:05 +1100)
committerNick Downing <downing.nick@gmail.com>
Fri, 10 Feb 2017 13:06:03 +0000 (00:06 +1100)
lib/ccom/c0.h
lib/ccom/c11.c

index 4f86a65..eade606 100644 (file)
@@ -129,7 +129,7 @@ struct      cnode {
        int     type;
        int     *subsp;
        union   str *strp;
-       int     value;
+       _INT    value;
 };
 
 /*
@@ -140,7 +140,7 @@ struct lnode {
        int     type;
        int     *subsp;
        union   str *strp;
-       long    lvalue;
+       _LONG   lvalue;
 };
 
 /*
index 56e2f3d..2c1f91b 100644 (file)
@@ -981,7 +981,7 @@ void getree() {
                } else {
                        tp = getblk(sizeof(struct tname));
                        tp->t.type = geti();
-                       tp->n.nloc = geti();
+                       tp->n.nloc = (_INT)geti(); /* make it sign extended */
                }
                tp->t.op = NAME;
                tp->n.class = t;