Skip to content
Snippets Groups Projects
Commit 5e146661 authored by Chris Lattner's avatar Chris Lattner
Browse files

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
parent e32c23a5
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment