mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
gallium/radeon: only dispose locally created target machine in radeon_llvm_compile
Unify the cleanup paths of the function rather than duplicating code.
Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 0a6a17b9d7)
This commit is contained in:
parent
ca30800dfd
commit
d4d2315d65
1 changed files with 3 additions and 2 deletions
|
|
@ -188,8 +188,8 @@ unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_shader_binary *binar
|
|||
if (mem_err) {
|
||||
fprintf(stderr, "%s: %s", __FUNCTION__, err);
|
||||
FREE(err);
|
||||
LLVMDisposeTargetMachine(tm);
|
||||
return 1;
|
||||
rval = 1;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (0 != rval) {
|
||||
|
|
@ -205,6 +205,7 @@ unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_shader_binary *binar
|
|||
/* Clean up */
|
||||
LLVMDisposeMemoryBuffer(out_buffer);
|
||||
|
||||
out:
|
||||
if (dispose_tm) {
|
||||
LLVMDisposeTargetMachine(tm);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue