[llvm-commits] [llvm] r155329 - /llvm/trunk/lib/Support/StringRef.cpp
Chris Lattner
sabre at nondot.org
Sun Apr 22 17:27:55 PDT 2012
Author: lattner
Date: Sun Apr 22 19:27:54 2012
New Revision: 155329
URL: http://llvm.org/viewvc/llvm-project?rev=155329&view=rev
Log:
Don't die with an assertion if the Result bitwidth is already correct. This
fixes an assert reading "1239123123123123" when the result is already 64-bit.
Modified:
llvm/trunk/lib/Support/StringRef.cpp
Modified: llvm/trunk/lib/Support/StringRef.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/StringRef.cpp?rev=155329&r1=155328&r2=155329&view=diff
==============================================================================
--- llvm/trunk/lib/Support/StringRef.cpp (original)
+++ llvm/trunk/lib/Support/StringRef.cpp Sun Apr 22 19:27:54 2012
@@ -391,7 +391,7 @@
unsigned BitWidth = Log2Radix * Str.size();
if (BitWidth < Result.getBitWidth())
BitWidth = Result.getBitWidth(); // don't shrink the result
- else
+ else if (BitWidth > Result.getBitWidth())
Result = Result.zext(BitWidth);
APInt RadixAP, CharAP; // unused unless !IsPowerOf2Radix
More information about the llvm-commits
mailing list