mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-27 00:15:58 +00:00
We want the number of bits needed, not the power of 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35977 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f6a15eb1a1
commit
0468ab3025
@ -693,7 +693,7 @@ uint32_t APInt::getBitsNeeded(const char* str, uint32_t slen, uint8_t radix) {
|
||||
APInt tmp(sufficient, str, slen, radix);
|
||||
|
||||
// Compute how many bits are required.
|
||||
return isNegative + tmp.logBase2();
|
||||
return isNegative + tmp.logBase2() + 1;
|
||||
}
|
||||
|
||||
uint64_t APInt::getHashValue() const {
|
||||
|
Loading…
x
Reference in New Issue
Block a user