X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=ir.c;h=a28b07e95f3452d5b68999a1005799fbd41480c9;hp=50100107b3f281c457374774202995a98358815e;hb=a6ac90215b6238987c0bb0edcf1fbed2e9469266;hpb=3593a1b6b89ff690b8e89a31707468aad014b7b1 diff --git a/ir.c b/ir.c index 5010010..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]; @@ -3327,7 +3327,7 @@ static bool ir_builder_gen_global(ir_builder *self, ir_value *global, bool isloc size_t i; int32_t *iptr; prog_section_def def; - bool pushdef = false; + bool pushdef = opts.optimizeoff; def.type = global->vtype; def.offset = vec_size(code_globals);