Avoid UB in maxIntN(64).
authorJustin Lebar <jlebar@google.com>
Sun, 17 Jul 2016 18:19:26 +0000 (18:19 +0000)
committerJustin Lebar <jlebar@google.com>
Sun, 17 Jul 2016 18:19:26 +0000 (18:19 +0000)
commitb59c1dd5cf31b90ac94164259791d74acd1d9ff3
tree21291014047e7ced2c796219e8616eb4d423d191
parent6df6bde6943dbd4ff1183b186d11e49e322ebccc
Avoid UB in maxIntN(64).

Summary:
Previously we were relying on 2's complement underflow in an int64_t.
Now we cast to a uint64_t so we explicitly get the behavior we want.

Reviewers: rnk

Subscribers: dylanmckay, llvm-commits

Differential Revision: https://reviews.llvm.org/D22445

llvm-svn: 275722
llvm/include/llvm/Support/MathExtras.h