mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-11 03:13:06 +00:00
do not set a function-defs nargs to > 8
This commit is contained in:
parent
149481b80c
commit
ed6189e655
1 changed files with 6 additions and 3 deletions
9
ir.c
9
ir.c
|
@ -2391,7 +2391,6 @@ static bool gen_global_pointer(ir_value *global)
|
|||
return true;
|
||||
}
|
||||
|
||||
static void ir_gen_extparam(ir_builder *ir);
|
||||
static bool gen_blocks_recursive(ir_function *func, ir_block *block)
|
||||
{
|
||||
prog_section_statement stmt;
|
||||
|
@ -2537,8 +2536,10 @@ tailcall:
|
|||
ir_value *param = instr->params[p];
|
||||
ir_value *target;
|
||||
|
||||
if (p-8 >= vec_size(ir->extparams))
|
||||
ir_gen_extparam(ir);
|
||||
if (p-8 >= vec_size(ir->extparams)) {
|
||||
irerror(instr->context, "Not enough extparam-globals have been created");
|
||||
return false;
|
||||
}
|
||||
|
||||
target = ir->extparams[p-8];
|
||||
|
||||
|
@ -2688,6 +2689,8 @@ static bool gen_global_function(ir_builder *ir, ir_value *global)
|
|||
fun.file = ir_builder_filestring(ir, global->context.file);
|
||||
fun.profile = 0; /* always 0 */
|
||||
fun.nargs = vec_size(irfun->params);
|
||||
if (fun.nargs > 8)
|
||||
fun.nargs = 8;
|
||||
|
||||
for (i = 0;i < 8; ++i) {
|
||||
if (i >= fun.nargs)
|
||||
|
|
Loading…
Reference in a new issue