Dispose LLVM context after TargetMachine
The TargetMachine may be referencing data in the context. In particular, at least the GlobalISel instruction selector stored in the TM may reference a TrackedMDNode DebugLoc that destruction of the TargetMachine will try to untrack.
This commit is contained in:
parent
d20e798ad8
commit
6a454edce9
1 changed files with 1 additions and 1 deletions
|
@ -352,8 +352,8 @@ impl ModuleLlvm {
|
|||
impl Drop for ModuleLlvm {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
llvm::LLVMContextDispose(&mut *(self.llcx as *mut _));
|
||||
llvm::LLVMRustDisposeTargetMachine(&mut *(self.tm as *mut _));
|
||||
llvm::LLVMContextDispose(&mut *(self.llcx as *mut _));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue