[ORC] De-register eh-frames in the RTDyldObjectLinkingLayer destructor.

This matches the behavior of the legacy layer, which automatically deregistered
frames.
This commit is contained in:
Lang Hames 2019-12-20 21:08:35 -08:00
parent a32f8dd195
commit 9f4f237e29
2 changed files with 8 additions and 0 deletions

View File

@ -54,6 +54,8 @@ public:
RTDyldObjectLinkingLayer(ExecutionSession &ES,
GetMemoryManagerFunction GetMemoryManager);
~RTDyldObjectLinkingLayer();
/// Emit the object.
void emit(MaterializationResponsibility R,
std::unique_ptr<MemoryBuffer> O) override;

View File

@ -78,6 +78,12 @@ RTDyldObjectLinkingLayer::RTDyldObjectLinkingLayer(
ExecutionSession &ES, GetMemoryManagerFunction GetMemoryManager)
: ObjectLayer(ES), GetMemoryManager(GetMemoryManager) {}
RTDyldObjectLinkingLayer::~RTDyldObjectLinkingLayer() {
std::lock_guard<std::mutex> Lock(RTDyldLayerMutex);
for (auto &MemMgr : MemMgrs)
MemMgr->deregisterEHFrames();
}
void RTDyldObjectLinkingLayer::emit(MaterializationResponsibility R,
std::unique_ptr<MemoryBuffer> O) {
assert(O && "Object must not be null");