mesa: issue error, don't crash, when calling a prototyped, but undefined function
authorBrian Paul <brian.paul@tungstengraphics.com>
Sat, 22 Nov 2008 00:22:16 +0000 (17:22 -0700)
committerBrian Paul <brian.paul@tungstengraphics.com>
Mon, 24 Nov 2008 20:11:05 +0000 (13:11 -0700)
Bug #18659.

src/mesa/shader/slang/slang_codegen.c

index 882a6534e57a762df018227f7ddfb33e5f286c79..0dacfee1da2a1b9553f1e2b136d9e9c46f69a616 100644 (file)
@@ -2020,6 +2020,13 @@ _slang_gen_function_call_name(slang_assemble_ctx *A, const char *name,
                            name);
       return NULL;
    }
+   if (!fun->body) {
+      slang_info_log_error(A->log,
+                           "Function '%s' prototyped but not defined.  "
+                           "Separate compilation units not supported.",
+                           name);
+      return NULL;
+   }
 
    n = _slang_gen_function_call(A, fun, oper, dest);