diff options
Diffstat (limited to 'llvm/lib/MC/WasmObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/WasmObjectWriter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp index 8ddbe92..c5a95cb 100644 --- a/llvm/lib/MC/WasmObjectWriter.cpp +++ b/llvm/lib/MC/WasmObjectWriter.cpp @@ -746,10 +746,11 @@ static void addData(SmallVectorImpl<char> &DataBytes, uint32_t WasmObjectWriter::getRelocationIndexValue(const WasmRelocationEntry &RelEntry) { if (RelEntry.Type == wasm::R_WASM_TYPE_INDEX_LEB) { - if (!TypeIndices.count(RelEntry.Symbol)) + auto It = TypeIndices.find(RelEntry.Symbol); + if (It == TypeIndices.end()) report_fatal_error("symbol not found in type index space: " + RelEntry.Symbol->getName()); - return TypeIndices[RelEntry.Symbol]; + return It->second; } return RelEntry.Symbol->getIndex(); |