aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/LiteralSupport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Lex/LiteralSupport.cpp')
-rw-r--r--lib/Lex/LiteralSupport.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp
index f63e6cfffc..1b86ba5def 100644
--- a/lib/Lex/LiteralSupport.cpp
+++ b/lib/Lex/LiteralSupport.cpp
@@ -481,10 +481,9 @@ bool NumericLiteralParser::GetIntegerValue(llvm::APInt &Val) {
Val *= RadixVal;
OverflowOccurred |= Val.udiv(RadixVal) != OldVal;
- OldVal = Val;
// Add value, did overflow occur on the value?
+ // (a + b) ult b <=> overflow
Val += CharVal;
- OverflowOccurred |= Val.ult(OldVal);
OverflowOccurred |= Val.ult(CharVal);
}
return OverflowOccurred;