summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2015-03-12 09:57:43 +0000
committerJose Fonseca <jfonseca@vmware.com>2015-03-12 10:01:09 +0000
commit70dc8a9930f561d7ce6db7e58b5bc9b4d940e37b (patch)
treea09040103043218692c9e551f19fe3123082b0d4
parent30916a5ef008a84e53d9821ccc11a0dee50fe77b (diff)
gallivm: Prevent double delete on LLVM 3.6
std::unique_ptr takes ownership of MM, and a double delete could ensure in case of an error, as pointed out by Chris Vine in https://bugs.freedesktop.org/show_bug.cgi?id=89387 Reviewed-by: Chris Vine <chris@cvine.freeserve.co.uk>
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_misc.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index e2578cfccb8..d60db91df95 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -502,6 +502,7 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
#if HAVE_LLVM >= 0x0306
builder.setMCJITMemoryManager(std::unique_ptr<RTDyldMemoryManager>(MM));
+ MM = NULL; // onwership taken by std::unique_ptr
#else
builder.setMCJITMemoryManager(MM);
#endif