Fix: wrong offsets for locals when < -32768
authorceriel <none@none>
Wed, 8 Nov 1995 11:08:09 +0000 (11:08 +0000)
committerceriel <none@none>
Wed, 8 Nov 1995 11:08:09 +0000 (11:08 +0000)
util/ego/ra/ra.c
util/ego/ra/ra_xform.c

index a2f3888..2399ed4 100644 (file)
@@ -251,6 +251,21 @@ STATIC bool useful_item(item)
 }
 
 
+STATIC cleantimeset(s)
+       lset s;
+{
+       register Lindex i;
+       register time_p t;
+
+       for (i = Lfirst(s); i != (Lindex) 0; i = Lnext(i,s)) {
+               t = (time_p) Lelem(i);
+               oldtime(t);
+       }
+       Ldeleteset(s);
+}
+
+
+
 STATIC item_p cat_items(items)
        item_p items[];
 {
@@ -296,21 +311,6 @@ STATIC clean_interval(list)
 
 
 
-STATIC cleantimeset(s)
-       lset s;
-{
-       register Lindex i;
-       register time_p t;
-
-       for (i = Lfirst(s); i != (Lindex) 0; i = Lnext(i,s)) {
-               t = (time_p) Lelem(i);
-               oldtime(t);
-       }
-       Ldeleteset(s);
-}
-
-
-
 STATIC clean_allocs(list)
        alloc_p list;
 {
index 89760d9..28c295f 100644 (file)
@@ -268,7 +268,14 @@ STATIC apply_alloc(b,l,alloc)
        line_p newcode;
 
        if (alloc->al_item->it_type == LOCALVAR) {
-               SHORT(l) = alloc->al_dummy;
+               if ((short) (alloc->al_dummy) == alloc->al_dummy) {
+                       TYPE(l) = OPSHORT;
+                       SHORT(l) = alloc->al_dummy;
+               }
+               else {
+                       TYPE(l) = OPOFFSET;
+                       OFFSET(l) = alloc->al_dummy;
+               }
        } else {
                newcode = repl_code(l,alloc->al_dummy);
                replace_line(l,b,newcode);
@@ -491,7 +498,7 @@ xform_proc(p,alloclist,nrinstrs,instrmap)
 
 
 
-STATIC bool always_in_reg(off,allocs,size_out)
+bool always_in_reg(off,allocs,size_out)
        offset off;
        alloc_p allocs;
        short *size_out;