mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-02-17 09:02:25 +00:00
Generate extparams on calls too since the to-be-called function needs not be generated first after all
This commit is contained in:
parent
b966cd4f4d
commit
624e95ee03
1 changed files with 7 additions and 4 deletions
11
ir.c
11
ir.c
|
@ -193,6 +193,11 @@ uint16_t type_not_instr[TYPE_COUNT] = {
|
||||||
AINSTR_END, /* array */
|
AINSTR_END, /* array */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* protos */
|
||||||
|
static void ir_gen_extparam(ir_builder *ir);
|
||||||
|
|
||||||
|
/* error functions */
|
||||||
|
|
||||||
static void irerror(lex_ctx ctx, const char *msg, ...)
|
static void irerror(lex_ctx ctx, const char *msg, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
@ -2671,10 +2676,8 @@ tailcall:
|
||||||
ir_value *param = instr->params[p];
|
ir_value *param = instr->params[p];
|
||||||
ir_value *targetparam;
|
ir_value *targetparam;
|
||||||
|
|
||||||
if (p-8 >= vec_size(ir->extparams)) {
|
if (p-8 >= vec_size(ir->extparams))
|
||||||
irerror(instr->context, "Not enough extparam-globals have been created");
|
ir_gen_extparam(ir);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
targetparam = ir->extparams[p-8];
|
targetparam = ir->extparams[p-8];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue