]> granicus.if.org Git - clang/commitdiff
Fix MSVC "signed/unsigned mismatch" warning. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 3 Jul 2019 10:26:28 +0000 (10:26 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 3 Jul 2019 10:26:28 +0000 (10:26 +0000)
Fixes PR42426.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365019 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/SourceManager.cpp

index c57f1fd856ae39e42e79b07027898d41c2a79a27..c7588aa796fe70f6d3894af1e230919188f6966e 100644 (file)
@@ -113,7 +113,8 @@ const llvm::MemoryBuffer *ContentCache::getBuffer(DiagnosticsEngine &Diag,
   // Clang (including elsewhere in this file!) use 'unsigned' to represent file
   // offsets, line numbers, string literal lengths, and so on, and fail
   // miserably on large source files.
-  if (ContentsEntry->getSize() >= std::numeric_limits<unsigned>::max()) {
+  if ((uint64_t)ContentsEntry->getSize() >=
+      std::numeric_limits<unsigned>::max()) {
     // We can't make a memory buffer of the required size, so just make a small
     // one. We should never hit a situation where we've already parsed to a
     // later offset of the file, so it shouldn't matter that the buffer is