]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Generate extparams on calls too since the to-be-called function needs not be generate...
authorWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 1 Dec 2012 10:43:54 +0000 (11:43 +0100)
committerWolfgang (Blub) Bumiller <blub@speed.at>
Sat, 1 Dec 2012 10:43:54 +0000 (11:43 +0100)
ir.c

diff --git a/ir.c b/ir.c
index b564baec0b36a44dc1ad4aa87f0cfa816c2c7697..f1ffc7fa4fbaa5e0ca265fd0ce8ed43953620c0b 100644 (file)
--- 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];