diff --git a/llvm/lib/Bitstream/Reader/BitstreamReader.cpp b/llvm/lib/Bitstream/Reader/BitstreamReader.cpp index 5b2c76350029b..fed9994db2ae8 100644 --- a/llvm/lib/Bitstream/Reader/BitstreamReader.cpp +++ b/llvm/lib/Bitstream/Reader/BitstreamReader.cpp @@ -334,7 +334,8 @@ Expected BitstreamCursor::readRecord(unsigned AbbrevID, // Figure out where the end of this blob will be including tail padding. size_t CurBitPos = GetCurrentBitNo(); - const size_t NewEnd = CurBitPos + alignTo(NumElts, 4) * 8; + const size_t NewEnd = + CurBitPos + static_cast(alignTo(NumElts, 4)) * 8; // Make sure the bitstream is large enough to contain the blob. if (!canSkipToPos(NewEnd/8))