mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-05-31 00:30:57 +00:00
allow rel_def_op relocs to point just past the end of the code. needed for
jump tables.
This commit is contained in:
parent
01594e239e
commit
5962900e25
2 changed files with 8 additions and 3 deletions
|
@ -51,6 +51,8 @@ typedef struct reloc_s {
|
||||||
struct reloc_s *next;
|
struct reloc_s *next;
|
||||||
int ofs;
|
int ofs;
|
||||||
reloc_type type;
|
reloc_type type;
|
||||||
|
int line;
|
||||||
|
string_t file;
|
||||||
} reloc_t;
|
} reloc_t;
|
||||||
|
|
||||||
struct statement_s;
|
struct statement_s;
|
||||||
|
|
|
@ -100,9 +100,10 @@ relocate_refs (reloc_t *refs, int ofs)
|
||||||
pr.code->code[refs->ofs].c = o;
|
pr.code->code[refs->ofs].c = o;
|
||||||
break;
|
break;
|
||||||
case rel_def_op:
|
case rel_def_op:
|
||||||
if (ofs >= pr.code->size)
|
if (ofs > pr.code->size) {
|
||||||
error (0, "invalid statement offset");
|
error (0, "invalid statement offset: %d >= %d, %d",
|
||||||
else
|
ofs, pr.code->size, refs->ofs);
|
||||||
|
} else
|
||||||
G_INT (refs->ofs) = ofs;
|
G_INT (refs->ofs) = ofs;
|
||||||
break;
|
break;
|
||||||
case rel_def_def:
|
case rel_def_def:
|
||||||
|
@ -126,6 +127,8 @@ new_reloc (int ofs, reloc_type type)
|
||||||
ALLOC (16384, reloc_t, refs, ref);
|
ALLOC (16384, reloc_t, refs, ref);
|
||||||
ref->ofs = ofs;
|
ref->ofs = ofs;
|
||||||
ref->type = type;
|
ref->type = type;
|
||||||
|
ref->line = pr.source_line;
|
||||||
|
ref->file = pr.source_file;
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue