projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e75542
)
Add assert for non-hexadecimal radixes.
author
Bill Wendling
<isanbard@gmail.com>
Sun, 16 Mar 2008 20:05:52 +0000
(20:05 +0000)
committer
Bill Wendling
<isanbard@gmail.com>
Sun, 16 Mar 2008 20:05:52 +0000
(20:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48421
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Support/APInt.cpp
patch
|
blob
|
history
diff --git
a/lib/Support/APInt.cpp
b/lib/Support/APInt.cpp
index 622d0f34362d704b82f2018a21cba2427845e96b..a853b92ae4106192a708fbf4e39ec2e55951ddfc 100644
(file)
--- a/
lib/Support/APInt.cpp
+++ b/
lib/Support/APInt.cpp
@@
-1940,6
+1940,10
@@
void APInt::fromString(uint32_t numbits, const char *str, uint32_t slen,
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");
}