From: Marek Olšák Date: Mon, 9 Apr 2018 23:55:10 +0000 (-0400) Subject: radeonsi: avoid a crash in gallivm_dispose_target_library_info X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3f0eaaf6d96bf627b6594ea2045ba1c0268dbac2;p=mesa.git radeonsi: avoid a crash in gallivm_dispose_target_library_info Reviewed-by: Timothy Arceri Tested-by: Benedikt Schemmer Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index aa92f889e6e..c7f1e27f6ba 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -164,8 +164,11 @@ static void si_destroy_compiler(struct si_compiler *compiler) LLVMDisposeMessage((char*)compiler->data_layout); if (compiler->passmgr) LLVMDisposePassManager(compiler->passmgr); +#if HAVE_LLVM < 0x0500 || HAVE_LLVM >= 0x0700 + /* This crashes on LLVM 5.0 and 6.0 and Ubuntu 18.04, so leak it there. */ if (compiler->target_library_info) gallivm_dispose_target_library_info(compiler->target_library_info); +#endif if (compiler->tm) LLVMDisposeTargetMachine(compiler->tm); }