Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions llvm/lib/ExecutionEngine/JITLink/MachOLinkGraphBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,12 @@ class MachOLinkGraphBuilder {
/// given index is out of range, or if no symbol has been added for the given
/// index.
Expected<NormalizedSymbol &> findSymbolByIndex(uint64_t Index) {
if (Index >= IndexToSymbol.size())
return make_error<JITLinkError>("Symbol index out of range");
auto *Sym = IndexToSymbol[Index];
if (!Sym)
auto I = IndexToSymbol.find(Index);
if (I == IndexToSymbol.end())
return make_error<JITLinkError>("No symbol at index " +
formatv("{0:d}", Index));
return *Sym;
assert(I->second && "Null symbol at index");
return *I->second;
}

/// Returns the symbol with the highest address not greater than the search
Expand Down