mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
set current_func while building the init function to avoid issues with code expecting current_func to be set.
This commit is contained in:
parent
9ac15436d9
commit
bfee029249
1 changed files with 3 additions and 1 deletions
|
@ -731,7 +731,8 @@ class_finish_module (void)
|
|||
pr.scope, st_extern);
|
||||
|
||||
init_def = get_def (&type_function, ".ctor", pr.scope, st_static);
|
||||
init_func = new_function (".ctor");
|
||||
current_func = init_func = new_function (".ctor");
|
||||
add_function (init_func);
|
||||
init_func->def = init_def;
|
||||
reloc_def_func (init_func, init_def->ofs);
|
||||
init_func->code = pr.code->size;
|
||||
|
@ -745,6 +746,7 @@ class_finish_module (void)
|
|||
0, 0)));
|
||||
emit_function (init_func, init_expr);
|
||||
finish_function (init_func);
|
||||
current_func = 0;
|
||||
}
|
||||
|
||||
protocol_t *
|
||||
|
|
Loading…
Reference in a new issue