add builtin mapping support (not used yet) and fix an uninitialized

variable
This commit is contained in:
Bill Currie 2004-01-06 06:08:59 +00:00
parent acd54afff7
commit d7592781d7
2 changed files with 6 additions and 2 deletions

View File

@ -316,6 +316,7 @@ struct progs_s {
struct hashtab_s *builtin_hash;
struct hashtab_s *builtin_num_hash;
unsigned bi_next;
unsigned (*bi_map)(progs_t *pr, unsigned binum);
struct hashtab_s *function_hash;
struct hashtab_s *global_hash;

View File

@ -189,10 +189,13 @@ PR_RelocateBuiltins (progs_t *pr)
func->first_statement = -bi->binum;
}
bi = PR_FindBuiltinNum (pr, -func->first_statement);
ind = -func->first_statement;
if (pr->bi_map)
ind = pr->bi_map (pr, ind);
bi = PR_FindBuiltinNum (pr, ind);
if (!bi || !(proc = bi->proc)) {
Sys_DPrintf ("WARNING: Bad builtin call number: %s = #%d\n",
bi_name, ind);
bi_name, -func->first_statement);
proc = bi_no_function;
}
((bfunction_t *) func)->func = proc;