Fix: wrong offsets for locals when < -32768

This commit is contained in:
ceriel 1995-11-08 11:08:09 +00:00
parent 4565576021
commit c1738933d7
2 changed files with 24 additions and 17 deletions

View 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;
{

View 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;