From 3f0eaaf6d96bf627b6594ea2045ba1c0268dbac2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 9 Apr 2018 19:55:10 -0400 Subject: [PATCH] radeonsi: avoid a crash in gallivm_dispose_target_library_info MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Timothy Arceri Tested-by: Benedikt Schemmer Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_pipe.c | 3 +++ 1 file changed, 3 insertions(+) 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); } -- 2.30.2