1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

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.

llvm-svn: 155329
This commit is contained in:
Chris Lattner 2012-04-23 00:27:54 +00:00
parent 0f9f58c75a
commit 4c6722a8a7

View File

@ -391,7 +391,7 @@ bool StringRef::getAsInteger(unsigned Radix, APInt &Result) const {
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