Index: llvm/lib/ObjCopy/MachO/MachOWriter.cpp =================================================================== --- llvm/lib/ObjCopy/MachO/MachOWriter.cpp +++ llvm/lib/ObjCopy/MachO/MachOWriter.cpp @@ -520,7 +520,8 @@ uint8_t *CurrHashWritePosition = HashWriteStart; while (CurrHashReadPosition < HashReadEnd) { StringRef Block(reinterpret_cast(CurrHashReadPosition), - std::min(HashReadEnd - CurrHashReadPosition, + std::min(static_cast(HashReadEnd + - CurrHashReadPosition), static_cast(CodeSignature.BlockSize))); SHA256 Hasher; Hasher.update(Block);