[cfe-commits] r57629 - /cfe/trunk/lib/Lex/LiteralSupport.cpp

Daniel Dunbar daniel at zuster.org
Wed Oct 15 23:39:30 PDT 2008


Author: ddunbar
Date: Thu Oct 16 01:39:30 2008
New Revision: 57629

URL: http://llvm.org/viewvc/llvm-project?rev=57629&view=rev
Log:
Simplify overflow-on-add check in NumericLiteralParser::GetIntegerValue.

Modified:
    cfe/trunk/lib/Lex/LiteralSupport.cpp

Modified: cfe/trunk/lib/Lex/LiteralSupport.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/LiteralSupport.cpp?rev=57629&r1=57628&r2=57629&view=diff

==============================================================================
--- cfe/trunk/lib/Lex/LiteralSupport.cpp (original)
+++ cfe/trunk/lib/Lex/LiteralSupport.cpp Thu Oct 16 01:39:30 2008
@@ -481,10 +481,9 @@
     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;





More information about the cfe-commits mailing list