X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=ir.c;h=a28b07e95f3452d5b68999a1005799fbd41480c9;hp=e794860f078a998cbe1694799574cc55fec99d7a;hb=a32f59b256df8c0ca85ff3a958be6dad3f1c1b61;hpb=9f06e0e017a4dac0c6dc7b2a63ed1be2959213a2 diff --git a/ir.c b/ir.c index e794860..a28b07e 100644 --- a/ir.c +++ b/ir.c @@ -3151,14 +3151,14 @@ static bool gen_function_varargs_copy(ir_function *self) stmt.o3.s1 = 0; maxparams = numparams + self->max_varargs; for (i = numparams; i < maxparams; ++i) { - if (i <= 8) { + if (i < 8) { stmt.o1.u1 = OFS_PARM0 + 3*i; stmt.o2.u1 = ir_value_code_addr(self->locals[i]); code_push_statement(&stmt, self->context.line); continue; } - ext = i - 9; - if (ext >= vec_size(ir->extparams)) + ext = i - 8; + while (ext >= vec_size(ir->extparams)) ir_gen_extparam(ir); ep = ir->extparams[ext];