]> git.rm.cloudns.org Git - xonotic/gmqcc.git/commitdiff
Guard against nullfunc
authorDale Weiler <killfieldengine@gmail.com>
Sat, 23 Nov 2013 15:58:03 +0000 (10:58 -0500)
committerDale Weiler <killfieldengine@gmail.com>
Sat, 23 Nov 2013 15:58:03 +0000 (10:58 -0500)
intrin.c

index d642d30b8afdb2fdcb015dd7463c8e3d6d467fc1..3fa0d708951eb1adaacfe06185ee93fe43994370 100644 (file)
--- a/intrin.c
+++ b/intrin.c
@@ -902,12 +902,11 @@ static ast_expression *intrin_func_self(intrin_t *intrin, const char *name, cons
     if ((find = intrin_func_try(intrin, offsetof(intrin_func_t, alias), name)))
         return find;
 
-    if (from)
+    if (from) {
         intrin_error(intrin, "need function `%s', compiler depends on it for `__builtin_%s'", name, from);
-    else
-        intrin_error(intrin, "need function `%s', compiler depends on it", name);
-
-    return intrin_func(intrin, "#nullfunc");
+        return intrin_func_self(intrin, "#nullfunc", NULL);
+    }
+    return NULL;
 }
 
 ast_expression *intrin_func(intrin_t *intrin, const char *name) {