[llvm-commits] [llvm] r48421 - /llvm/trunk/lib/Support/APInt.cpp

Bill Wendling isanbard at gmail.com
Sun Mar 16 13:05:53 PDT 2008


Author: void
Date: Sun Mar 16 15:05:52 2008
New Revision: 48421

URL: http://llvm.org/viewvc/llvm-project?rev=48421&view=rev
Log:
Add assert for non-hexadecimal radixes.

Modified:
    llvm/trunk/lib/Support/APInt.cpp

Modified: llvm/trunk/lib/Support/APInt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=48421&r1=48420&r2=48421&view=diff

==============================================================================
--- llvm/trunk/lib/Support/APInt.cpp (original)
+++ llvm/trunk/lib/Support/APInt.cpp Sun Mar 16 15:05:52 2008
@@ -1940,6 +1940,10 @@
         assert(0 && "huh? we shouldn't get here");
     } else if (isdigit(cdigit)) {
       digit = cdigit - '0';
+      assert((radix == 10 ||
+              (radix == 8 && digit != 8 && digit != 9) ||
+              (radix == 2 && (digit == 0 || digit == 1))) &&
+             "Invalid digit in string for given radix");
     } else {
       assert(0 && "Invalid character in digit string");
     }





More information about the llvm-commits mailing list