]> de.git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - parser.c
Fix handling on intrinsic folding, this closes #118.
[xonotic/gmqcc.git] / parser.c
index 3db28b39d99320f2027913338dc2bf9c54027538..c42e62d7957cd618af58bc1c8725dd3c494366d6 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -1227,7 +1227,7 @@ static bool parser_close_call(parser_t *parser, shunt *sy)
          * sy->out should I be doing here?
          */
         sy->out[fid] = syexp(foldval->node.context, foldval);
-        vec_shrinkby(sy->out, 1);
+        vec_shrinkby(sy->out, paramcount);
         vec_free(exprs);
 
         return true;
@@ -5088,6 +5088,13 @@ static bool parse_variable(parser_t *parser, ast_block *localblock, bool nofield
             var->expression.flags & AST_FLAG_ALIAS)
             var->desc = vstring;
 
+        if (parser_find_global(parser, var->name) && var->expression.flags & AST_FLAG_ALIAS) {
+            parseerror(parser, "function aliases cannot be forward declared");
+            retval = false;
+            goto cleanup;
+        }
+
+
         /* Part 1:
          * check for validity: (end_sys_..., multiple-definitions, prototypes, ...)
          * Also: if there was a prototype, `var` will be deleted and set to `proto` which