Skip to content

Commit e973262

Browse files
Update MathExtras.h
1 parent 5307a57 commit e973262

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

llvm/include/llvm/Support/MathExtras.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -786,15 +786,12 @@ std::enable_if_t<std::is_signed_v<T>, bool> MulOverflow(T X, T Y, T &Result) {
786786
U AbsResult = AbsX * AbsY;
787787
Result = IsNegative ? static_cast<T>(0-AbsResult) : static_cast<T>(AbsResult);
788788

789-
790-
791789
// Handle INT_MIN * -1 overflow case explicitly
792790
if ((X == std::numeric_limits<T>::min() && Y == -1) ||
793791
(Y == std::numeric_limits<T>::min() && X == -1)) {
794792
return true; // overflow
795793
}
796794

797-
798795
U Limit = IsNegative ? MaxNegative : MaxPositive;
799796

800797
if (AbsX > Limit / AbsY)

0 commit comments

Comments
 (0)