]> granicus.if.org Git - llvm/commit
[Object] Fix the return type of getOffset/getSize
authorAlexander Shaposhnikov <shal1t712@gmail.com>
Thu, 17 Oct 2019 18:48:07 +0000 (18:48 +0000)
committerAlexander Shaposhnikov <shal1t712@gmail.com>
Thu, 17 Oct 2019 18:48:07 +0000 (18:48 +0000)
commit453152dfa858db8e30f727835409a4b1ccd8fbb1
treeb42aec84c0ad4466443359debc885a8f13e49885
parentbad786f9bdfebfe666a8383413e7369c86954bdf
[Object] Fix the return type of getOffset/getSize

Header64.offset/Header64.size are uint64_t, thus we should not
truncate them to unit32_t. Moreover, there are a number of places
where we sum the offset and the size (e.g. in various checks in MachOUniversal.cpp),
the truncation causes issues since the offset/size can perfectly fit into uint32_t,
while the sum overflows.

Differential revision: https://reviews.llvm.org/D69126

Test plan: make check-all

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375154 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Object/MachOUniversal.h