From: Wolfgang (Blub) Bumiller Date: Sat, 1 Dec 2012 10:43:54 +0000 (+0100) Subject: Generate extparams on calls too since the to-be-called function needs not be generate... X-Git-Tag: 0.1.9~146 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=624e95ee0387c64091474285bb19e5a3a4253495;p=xonotic%2Fgmqcc.git Generate extparams on calls too since the to-be-called function needs not be generated first after all --- diff --git a/ir.c b/ir.c index b564bae..f1ffc7f 100644 --- a/ir.c +++ b/ir.c @@ -193,6 +193,11 @@ uint16_t type_not_instr[TYPE_COUNT] = { AINSTR_END, /* array */ }; +/* protos */ +static void ir_gen_extparam(ir_builder *ir); + +/* error functions */ + static void irerror(lex_ctx ctx, const char *msg, ...) { va_list ap; @@ -2671,10 +2676,8 @@ tailcall: ir_value *param = instr->params[p]; ir_value *targetparam; - if (p-8 >= vec_size(ir->extparams)) { - irerror(instr->context, "Not enough extparam-globals have been created"); - return false; - } + if (p-8 >= vec_size(ir->extparams)) + ir_gen_extparam(ir); targetparam = ir->extparams[p-8];