]> de.git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
nil check in paramter type checking
authorWolfgang Bumiller <blub@speed.at>
Mon, 31 Dec 2012 10:30:02 +0000 (11:30 +0100)
committerWolfgang Bumiller <blub@speed.at>
Mon, 31 Dec 2012 10:30:02 +0000 (11:30 +0100)
ast.c

diff --git a/ast.c b/ast.c
index 9d10cc6e7f5c46077fe3c2869d3b0a1e8381f011..f18499b257bd0cb9cf2fc5b98b6a39d07701f73e 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -909,7 +909,9 @@ bool ast_call_check_types(ast_call *self)
         count = vec_size(func->expression.params);
 
     for (i = 0; i < count; ++i) {
-        if (!ast_compare_type(self->params[i], (ast_expression*)(func->expression.params[i]))) {
+        if (self->params[i]->expression.vtype != TYPE_NIL &&
+            !ast_compare_type(self->params[i], (ast_expression*)(func->expression.params[i])))
+        {
             char texp[1024];
             char tgot[1024];
             ast_type_to_string(self->params[i], tgot, sizeof(tgot));