Fix the arguments of std::min
authorJianzhou Zhao <jianzhouzh@google.com>
Thu, 17 Sep 2020 04:02:19 +0000 (04:02 +0000)
committerJianzhou Zhao <jianzhouzh@google.com>
Thu, 17 Sep 2020 04:03:31 +0000 (04:03 +0000)
fixing
https://github.com/llvm/llvm-project/commit/11201315d5881a135faa5aa87f415ce03f99eb96

llvm/include/llvm/Bitstream/BitstreamWriter.h

index d5593d6..8dc135e 100644 (file)
@@ -158,7 +158,7 @@ public:
     // Copy data to update into Bytes from the file FS and the buffer Out.
     char Bytes[8];
     size_t BytesNum = StartBit ? 8 : 4;
-    size_t BytesFromDisk = std::min(BytesNum, NumOfFlushedBytes - ByteNo);
+    size_t BytesFromDisk = std::min(static_cast<uint64_t>(BytesNum), NumOfFlushedBytes - ByteNo);
     size_t BytesFromBuffer = BytesNum - BytesFromDisk;
 
     // When unaligned, copy existing data into Bytes from the file FS and the