mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
Add assert for non-hexadecimal radixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48421 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1e75542cc4
commit
f7a91e68a8
@ -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");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user