radeonsi: avoid a crash in gallivm_dispose_target_library_info

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Tested-by: Benedikt Schemmer <ben at besd.de>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Marek Olšák 2018-04-09 19:55:10 -04:00
parent e75fc8d033
commit 3f0eaaf6d9
1 changed files with 3 additions and 0 deletions

View File

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