Summary: | Double delete in lp_bld_misc.cpp | ||
---|---|---|---|
Product: | Mesa | Reporter: | Chris Vine <vine35792468> |
Component: | Mesa core | Assignee: | mesa-dev |
Status: | RESOLVED FIXED | QA Contact: | Jose Fonseca <jfonseca> |
Severity: | normal | ||
Priority: | medium | ||
Version: | 10.5 | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Chris Vine
2015-03-01 23:12:26 UTC
Would this fix it? diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp index 5210acc..7387ffb 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; #else builder.setMCJITMemoryManager(MM); #endif That will work fine. This does beg the question whether the code is correct for llvm < 3.6 (it fixes llvm >= 3.6). (In reply to Chris Vine from comment #2) > That will work fine. Thanks. > This does beg the question whether the code is correct for llvm < 3.6 (it > fixes llvm >= 3.6). I believe so. LLVM 3.4 and 3.3's documentation for setMCJITMemoryManager/setJITMemoryManager state they only take onwership if builder.create() is successful. And indeed we only delete MM when builder.create() fails. Fixed on http://cgit.freedesktop.org/mesa/mesa/commit/?id=70dc8a9930f561d7ce6db7e58b5bc9b4d940e37b |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.