From 716ccb11a25bdec19921e931bc7bcfb39c94896c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 21 Nov 2008 17:22:16 -0700 Subject: [PATCH] mesa: issue error, don't crash, when calling a prototyped, but undefined function Bug #18659. (cherry picked from commit 4f05893415a2d6f29b29f4daf991ea95a1891a81) --- src/mesa/shader/slang/slang_codegen.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 10faaeabc5c..fa653055f32 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2017,6 +2017,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); -- 2.30.2