make sure def->space points to the space the def's location is allocated from to ensure that freeing the location works properly (fixes the bogus address triggered by prozaccoop: thanks, phrosty)

This commit is contained in:
Bill Currie 2010-02-22 13:11:41 +00:00 committed by Jeff Teunissen
parent 56d01ce267
commit fac98536f0

View file

@ -276,6 +276,9 @@ get_def (type_t *type, const char *name, scope_t *scope,
space = pr.near_data;
break;
}
// new_def sets def->space to the scope's space, but that is generally
// not valid for st_static or st_extern
def->space = space;
if (space) {
if (type->type == ev_field && type->aux_type == &type_vector)
def->ofs = new_location (type->aux_type, space);