summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/DebugInfo/PDB/Native/PDBStringTable.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2019-01-27 16:42:12 +0000
committerpatrick <patrick@openbsd.org>2019-01-27 16:42:12 +0000
commitb773203fb58f3ef282fb69c832d8710cab5bc82d (patch)
treee75913f147570fbd75169647b144df85b88a038c /gnu/llvm/lib/DebugInfo/PDB/Native/PDBStringTable.cpp
parenttweak errno in previous (diff)
downloadwireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.tar.xz
wireguard-openbsd-b773203fb58f3ef282fb69c832d8710cab5bc82d.zip
Import LLVM 7.0.1 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/DebugInfo/PDB/Native/PDBStringTable.cpp')
-rw-r--r--gnu/llvm/lib/DebugInfo/PDB/Native/PDBStringTable.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/gnu/llvm/lib/DebugInfo/PDB/Native/PDBStringTable.cpp b/gnu/llvm/lib/DebugInfo/PDB/Native/PDBStringTable.cpp
index f1c10357132..afeea32043d 100644
--- a/gnu/llvm/lib/DebugInfo/PDB/Native/PDBStringTable.cpp
+++ b/gnu/llvm/lib/DebugInfo/PDB/Native/PDBStringTable.cpp
@@ -122,7 +122,10 @@ Expected<uint32_t> PDBStringTable::getIDForString(StringRef Str) const {
// we iterate the entire array.
uint32_t Index = (Start + I) % Count;
+ // If we find 0, it means the item isn't in the hash table.
uint32_t ID = IDs[Index];
+ if (ID == 0)
+ return make_error<RawError>(raw_error_code::no_entry);
auto ExpectedStr = getStringForID(ID);
if (!ExpectedStr)
return ExpectedStr.takeError();