From c1738933d7887d920c45f440fa89273e3c52f26d Mon Sep 17 00:00:00 2001 From: ceriel Date: Wed, 8 Nov 1995 11:08:09 +0000 Subject: [PATCH] Fix: wrong offsets for locals when < -32768 --- util/ego/ra/ra.c | 30 +++++++++++++++--------------- util/ego/ra/ra_xform.c | 11 +++++++++-- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/util/ego/ra/ra.c b/util/ego/ra/ra.c index a2f38882b..2399ed47e 100644 --- a/util/ego/ra/ra.c +++ b/util/ego/ra/ra.c @@ -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; { diff --git a/util/ego/ra/ra_xform.c b/util/ego/ra/ra_xform.c index 89760d9f1..28c295f0d 100644 --- a/util/ego/ra/ra_xform.c +++ b/util/ego/ra/ra_xform.c @@ -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;