Try to fix the assert in Alignment::alignAddr to work on 32-bit

Hopefully fixing the AlignmentDeathTest.AlignAddr failures (e.g. at
http://lab.llvm.org:8011/builders/clang-cmake-armv7-quick/builds/10925)

llvm-svn: 375090
This commit is contained in:
Hans Wennborg 2019-10-17 09:01:39 +00:00
parent 8cc28e1080
commit 666e447cb4

View File

@ -183,7 +183,8 @@ inline uint64_t alignTo(uint64_t Size, MaybeAlign A) {
/// Aligns `Addr` to `Alignment` bytes, rounding up.
inline uintptr_t alignAddr(const void *Addr, Align Alignment) {
uintptr_t ArithAddr = reinterpret_cast<uintptr_t>(Addr);
assert(ArithAddr + Alignment.value() - 1 >= ArithAddr && "Overflow");
assert(static_cast<uintptr_t>(ArithAddr + Alignment.value() - 1) >=
ArithAddr && "Overflow");
return alignTo(ArithAddr, Alignment);
}