Skip to content

Commit acab8c1

Browse files
author
Martin Mory
committed
incorporate feedback from Fabian in PR
1 parent 4c8c491 commit acab8c1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/Utils/LLVMShorthands.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,14 +435,15 @@ ModulesToSlotTracker::getSlotTrackerForModule(const llvm::Module *M) {
435435
if (M == nullptr && ret == nullptr) {
436436
ret = std::make_unique<llvm::ModuleSlotTracker>(M);
437437
}
438+
assert(ret != nullptr && "no ModuleSlotTracker instance for module cached");
438439
return *ret;
439440
}
440441

441442
void ModulesToSlotTracker::updateMSTForModule(const llvm::Module *M) {
442443
MToST[M] = std::make_unique<llvm::ModuleSlotTracker>(M);
443444
}
444445
void ModulesToSlotTracker::deleteMSTForModule(const llvm::Module *M) {
445-
MToST[M] = nullptr;
446+
MToST.erase(M);
446447
}
447448

448449
} // namespace psr

0 commit comments

Comments
 (0)