]> granicus.if.org Git - llvm/commitdiff
[llvm-lipo] Add missing cast
authorAlexander Shaposhnikov <shal1t712@gmail.com>
Tue, 15 Oct 2019 20:10:34 +0000 (20:10 +0000)
committerAlexander Shaposhnikov <shal1t712@gmail.com>
Tue, 15 Oct 2019 20:10:34 +0000 (20:10 +0000)
Add missing cast (to correctly sum 32-bit integers).

Test plan: make check-all

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@374945 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-lipo/llvm-lipo.cpp

index ba413b10fb09fae4e134233017b54e14a3aa8c2f..a063fcec7574c46e5e1c8c722d8b8aeee79fc24e 100644 (file)
@@ -688,7 +688,8 @@ static void createUniversalBinary(SmallVectorImpl<Slice> &Slices,
     return sys::fs::can_execute(S.getBinary()->getFileName());
   });
   const uint64_t OutputFileSize =
-      FatArchList.back().offset + FatArchList.back().size;
+      static_cast<uint64_t>(FatArchList.back().offset) +
+      FatArchList.back().size;
   Expected<std::unique_ptr<FileOutputBuffer>> OutFileOrError =
       FileOutputBuffer::create(OutputFileName, OutputFileSize,
                                IsExecutable ? FileOutputBuffer::F_executable