diff --git a/llvm/include/llvm/Support/MathExtras.h b/llvm/include/llvm/Support/MathExtras.h index 15a67e402991..7ba5d8661ccc 100644 --- a/llvm/include/llvm/Support/MathExtras.h +++ b/llvm/include/llvm/Support/MathExtras.h @@ -54,12 +54,12 @@ inline bool isUInt32(int64_t Value) { template inline bool isInt(int64_t x) { - return -(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1)); + return N >= 64 || (-(INT64_C(1)<<(N-1)) <= x && x < (INT64_C(1)<<(N-1))); } template inline bool isUint(uint64_t x) { - return x < (UINT64_C(1)<= 64 || x < (UINT64_C(1)<