[ORC] Fix a memory leak in LLVMOrcIRTransformLayerSetTransform.
This function heap-allocates a ThreadSafeModule (the current C bindings assume that TSMs are always heap-allocated), but was failing to free it. Should fix http://llvm.org/PR56953.
This commit is contained in:
parent
424626953e
commit
bc062e034f
@ -892,7 +892,10 @@ void LLVMOrcIRTransformLayerSetTransform(
|
||||
assert(!TSMRef && "TSMRef was not reset to null on error");
|
||||
return unwrap(Err);
|
||||
}
|
||||
return std::move(*unwrap(TSMRef));
|
||||
assert(TSMRef && "Transform succeeded, but TSMRef was set to null");
|
||||
ThreadSafeModule Result = std::move(*unwrap(TSMRef));
|
||||
LLVMOrcDisposeThreadSafeModule(TSMRef);
|
||||
return std::move(Result);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user