diff --git a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp index 06ac98b0c5e13..40a7b86078d87 100644 --- a/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp +++ b/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp @@ -929,15 +929,17 @@ static int linkAndVerify() { StringRef SymbolName, StringRef KindNameFilter) -> Expected { - if (!StubMap.count(StubContainer)) + auto SMIt = StubMap.find(StubContainer); + if (SMIt == StubMap.end()) return make_error("Stub container not found: " + StubContainer, inconvertibleErrorCode()); - if (!StubMap[StubContainer].count(SymbolName)) + auto It = SMIt->second.find(SymbolName); + if (It == SMIt->second.end()) return make_error("Symbol name " + SymbolName + " in stub container " + StubContainer, inconvertibleErrorCode()); - auto &SI = StubMap[StubContainer][SymbolName]; + auto &SI = It->second; RuntimeDyldChecker::MemoryRegionInfo StubMemInfo; StubMemInfo.setTargetAddress(Dyld.getSectionLoadAddress(SI.SectionID) + SI.Offset);