[llvm] aec80c5 - Fix the arguments of std::min

Jianzhou Zhao via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 21:04:23 PDT 2020


Author: Jianzhou Zhao
Date: 2020-09-17T04:03:31Z
New Revision: aec80c5cfd1bda8e630fca0f3ed2a84659f68635

URL: https://github.com/llvm/llvm-project/commit/aec80c5cfd1bda8e630fca0f3ed2a84659f68635
DIFF: https://github.com/llvm/llvm-project/commit/aec80c5cfd1bda8e630fca0f3ed2a84659f68635.diff

LOG: Fix the arguments of std::min

fixing
https://github.com/llvm/llvm-project/commit/11201315d5881a135faa5aa87f415ce03f99eb96

Added: 
    

Modified: 
    llvm/include/llvm/Bitstream/BitstreamWriter.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Bitstream/BitstreamWriter.h b/llvm/include/llvm/Bitstream/BitstreamWriter.h
index d5593d6ea9f0..8dc135e6404d 100644
--- a/llvm/include/llvm/Bitstream/BitstreamWriter.h
+++ b/llvm/include/llvm/Bitstream/BitstreamWriter.h
@@ -158,7 +158,7 @@ class BitstreamWriter {
     // 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


        


More information about the llvm-commits mailing list