From 75d9cb0b323cd40d90fe3d6b8fc57fdeb0a18873 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Wed, 6 May 2026 21:47:11 +0200 Subject: [PATCH] llvmpipe: never pass a NULL function name to LLVMAddFunction LLVM seems to crash otherwise. Cc: mesa-stable Reviewed-by: Dave Airlie Acked-by: Adam Jackson Part-of: --- src/gallium/drivers/llvmpipe/lp_state_cs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe/lp_state_cs.c b/src/gallium/drivers/llvmpipe/lp_state_cs.c index f9139265d27..f901b05a4ce 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_cs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_cs.c @@ -470,7 +470,8 @@ generate_compute(struct llvmpipe_context *lp, LLVMTypeRef func_type = LLVMFunctionType(LLVMVoidTypeInContext(gallivm->context), args, num_args, 0); - LLVMValueRef lfunc = LLVMAddFunction(gallivm->module, func->name, func_type); + const char *func_name = func->name ? func->name : ""; + LLVMValueRef lfunc = LLVMAddFunction(gallivm->module, func_name, func_type); LLVMSetFunctionCallConv(lfunc, LLVMCCallConv); struct lp_build_fn *new_fn = ralloc(fns, struct lp_build_fn);