From 81c89f9e0f48ea47bef0c32bab378f60adf76d33 Mon Sep 17 00:00:00 2001 From: Kristina Brooks Date: Mon, 8 Oct 2018 09:03:17 +0000 Subject: [PATCH] [DebugInfo][PDB] Fix a signed/unsigned coversion warning Fix the following warning when compiling with clang (caused by commit rL343951): GlobalsStream.cpp:61:33: warning: comparison of integers of different signs: 'int' and 'uint32_t' This also avoids double evaluation of `GlobalsTable.HashBuckets.size()`. llvm-svn: 343957 --- lib/DebugInfo/PDB/Native/GlobalsStream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/DebugInfo/PDB/Native/GlobalsStream.cpp b/lib/DebugInfo/PDB/Native/GlobalsStream.cpp index b8c1feaeb3b..529f6703789 100644 --- a/lib/DebugInfo/PDB/Native/GlobalsStream.cpp +++ b/lib/DebugInfo/PDB/Native/GlobalsStream.cpp @@ -58,7 +58,7 @@ GlobalsStream::findRecordsByName(StringRef Name, uint32_t ChainStartOffset = GlobalsTable.HashBuckets[CompressedBucketIndex]; uint32_t NextChainStart = GlobalsTable.HashBuckets.size(); - if (CompressedBucketIndex + 1 < GlobalsTable.HashBuckets.size()) + if (static_cast(CompressedBucketIndex + 1) < NextChainStart) NextChainStart = GlobalsTable.HashBuckets[CompressedBucketIndex + 1]; ChainStartOffset /= 12; NextChainStart /= 12;