[Lldb-commits] [lldb] r343087 - [unittest] Fix NativeProcessProtocolTest.cpp (NFC)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 26 03:09:44 PDT 2018


Author: jdevlieghere
Date: Wed Sep 26 03:09:44 2018
New Revision: 343087

URL: http://llvm.org/viewvc/llvm-project?rev=343087&view=rev
Log:
[unittest] Fix NativeProcessProtocolTest.cpp (NFC)

Cast std::min's second argument to size_t to prevent conflicting types
for parameter deduction.

Modified:
    lldb/trunk/unittests/Host/NativeProcessProtocolTest.cpp

Modified: lldb/trunk/unittests/Host/NativeProcessProtocolTest.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Host/NativeProcessProtocolTest.cpp?rev=343087&r1=343086&r2=343087&view=diff
==============================================================================
--- lldb/trunk/unittests/Host/NativeProcessProtocolTest.cpp (original)
+++ lldb/trunk/unittests/Host/NativeProcessProtocolTest.cpp Wed Sep 26 03:09:44 2018
@@ -130,7 +130,7 @@ llvm::Expected<std::vector<uint8_t>> Fak
   if (Addr >= Data.size())
     return llvm::createStringError(llvm::inconvertibleErrorCode(),
                                    "Address out of range.");
-  Size = std::min(Size, Data.size() - Addr);
+  Size = std::min(Size, Data.size() - (size_t)Addr);
   return std::vector<uint8_t>(&Data[Addr], &Data[Addr + Size]);
 }
 
@@ -139,7 +139,7 @@ llvm::Expected<size_t> FakeMemory::Write
   if (Addr >= Data.size())
     return llvm::createStringError(llvm::inconvertibleErrorCode(),
                                    "Address out of range.");
-  size_t Size = std::min(Chunk.size(), Data.size() - Addr);
+  size_t Size = std::min(Chunk.size(), Data.size() - (size_t)Addr);
   std::copy_n(Chunk.begin(), Size, &Data[Addr]);
   return Size;
 }




More information about the lldb-commits mailing list