[ORC] Fix the type of RTDyldObjectLinkingLayer::NotifyLoadedFtor.

Bug found by Stefan Granitz. Thanks Stefan!




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314436 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Lang Hames 2017-09-28 17:43:07 +00:00
parent a10cceeff4
commit 5ed9e8f1fe
3 changed files with 12 additions and 3 deletions

View File

@ -99,8 +99,9 @@ public:
using RTDyldObjectLinkingLayerBase::ObjectPtr;
/// @brief Functor for receiving object-loaded notifications.
using NotifyLoadedFtor = std::function<void(ObjHandleT, const ObjectPtr &Obj,
const LoadedObjectInfo &)>;
using NotifyLoadedFtor =
std::function<void(ObjHandleT, const ObjectPtr &Obj,
const RuntimeDyld::LoadedObjectInfo &)>;
/// @brief Functor for receiving finalization notifications.
using NotifyFinalizedFtor = std::function<void(ObjHandleT)>;

View File

@ -341,7 +341,7 @@ private:
void operator()(RTDyldObjectLinkingLayerBase::ObjHandleT H,
const RTDyldObjectLinkingLayer::ObjectPtr &Obj,
const LoadedObjectInfo &Info) const {
const RuntimeDyld::LoadedObjectInfo &Info) const {
M.UnfinalizedSections[H] = std::move(M.SectionsAllocatedSinceLastLoad);
M.SectionsAllocatedSinceLastLoad = SectionAddrSet();
M.MemMgr->notifyObjectLoaded(&M, *Obj->getBinary());

View File

@ -255,4 +255,12 @@ TEST_F(RTDyldObjectLinkingLayerExecutionTest, NoPrematureAllocation) {
"(multiple unrelated objects loaded prior to finalization)";
}
TEST_F(RTDyldObjectLinkingLayerExecutionTest, TestNotifyLoadedSignature) {
RTDyldObjectLinkingLayer ObjLayer([]() { return nullptr; },
[this](decltype(ObjLayer)::ObjHandleT,
const decltype(ObjLayer)::ObjectPtr &obj,
const RuntimeDyld::LoadedObjectInfo &info) {
});
}
} // end anonymous namespace