Make sure initialized locals that are treated as constants don't get relocated. Fixes the airfist bug in prozac

This commit is contained in:
Bill Currie 2007-09-15 07:58:39 +00:00 committed by Jeff Teunissen
parent 3e50aae01f
commit 3431fea56d
2 changed files with 3 additions and 0 deletions

View file

@ -238,6 +238,7 @@ ReuseConstant (expr_t *expr, def_t *def)
def->ofs = cn->ofs;
def->initialized = def->constant = 1;
def->nosave = 1;
def->local = 0;
cn = def;
} else {
if (cn->type != type) {

View file

@ -468,6 +468,8 @@ finish_compilation (void)
num_localdefs += f->scope->space->size;
}
for (def = f->scope->head; def; def = def->def_next) {
if (!def->local)
continue;
def->ofs += df->parm_start;
relocate_refs (def->refs, def->ofs);
}