mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Ensure reused temps have the correct type.
The type of a temp may change through its life as it's really the location and name that are reused.
This commit is contained in:
parent
4e8e94a1b2
commit
1af4d5eeed
1 changed files with 6 additions and 6 deletions
|
@ -165,19 +165,19 @@ temp_def (etype_t type, int size)
|
|||
if ((temp = current_func->temp_defs[size - 1])) {
|
||||
current_func->temp_defs[size - 1] = temp->next;
|
||||
temp->next = 0;
|
||||
return temp;
|
||||
} else {
|
||||
ALLOC (16384, def_t, defs, temp);
|
||||
temp->offset = defspace_alloc_loc (space, size);
|
||||
*space->def_tail = temp;
|
||||
space->def_tail = &temp->next;
|
||||
temp->name = save_string (va (".tmp%d", current_func->temp_num++));
|
||||
}
|
||||
ALLOC (16384, def_t, defs, temp);
|
||||
temp->return_addr = __builtin_return_address (0);
|
||||
temp->name = save_string (va (".tmp%d", current_func->temp_num++));
|
||||
temp->type = ev_types[type];
|
||||
temp->file = pr.source_file;
|
||||
temp->line = pr.source_line;
|
||||
set_storage_bits (temp, st_local);
|
||||
temp->offset = defspace_alloc_loc (space, size);
|
||||
temp->space = space;
|
||||
*space->def_tail = temp;
|
||||
space->def_tail = &temp->next;
|
||||
return temp;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue