llvmpipe: never pass a NULL function name to LLVMAddFunction
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

LLVM seems to crash otherwise.

Cc: mesa-stable
Reviewed-by: Dave Airlie <airlied@redhat.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41404>
This commit is contained in:
Karol Herbst 2026-05-06 21:47:11 +02:00 committed by Marge Bot
parent 4bad47e991
commit 75d9cb0b32

View file

@ -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);