Don't do uint64_t(1) << 64 in maxUIntN.
authorJustin Lebar <jlebar@google.com>
Sat, 16 Jul 2016 00:59:41 +0000 (00:59 +0000)
committerJustin Lebar <jlebar@google.com>
Sat, 16 Jul 2016 00:59:41 +0000 (00:59 +0000)
commit8d56f47cfee9bde51bc5ed985c74b3e87185e2d0
tree48f90940316136c17b986c52ccab8bc4eaecc022
parent2a7248f06b10e966daa1077e707122af910a3067
Don't do uint64_t(1) << 64 in maxUIntN.

Summary:
This shift is undefined behavior (and, as compiled by clang, gives the
wrong answer for maxUIntN(64)).

Reviewers: mkuper

Subscribers: llvm-commits, jroelofs, rsmith

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

llvm-svn: 275656
llvm/include/llvm/Support/MathExtras.h
llvm/unittests/Support/MathExtrasTest.cpp