mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-27 06:34:11 +00:00
Undo the offset relocation of local defs.
The debug info expects local defs to be 0 based, so once relocations in the progs data have been completed, undo the local def offset relocation so that the correct offsets will be written to the debug info.
This commit is contained in:
parent
b2f0c9a127
commit
66447df6b3
1 changed files with 11 additions and 0 deletions
|
@ -908,6 +908,17 @@ qfo_to_progs (qfo_t *qfo, int *size)
|
|||
|
||||
qfo_relocate_refs (qfo);
|
||||
|
||||
// undo the relocation of the offsets of local defs so the local defs have
|
||||
// the correct offset in the debug info
|
||||
for (i = 0; i < qfo->num_funcs; i++) {
|
||||
dfunction_t *df = functions + i;
|
||||
qfo_func_t *qf = qfo->funcs + i;
|
||||
qfo_mspace_t *space = qfo->spaces + qf->locals_space;
|
||||
|
||||
for (j = 0; j < space->num_defs; j++)
|
||||
space->defs[j].offset -= df->parm_start;
|
||||
}
|
||||
|
||||
return progs;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue