mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-10 10:49:04 +08:00
Fix the fuzz
This commit is contained in:
parent
3ab8f48256
commit
431e4a913b
@ -767,7 +767,7 @@ Scalar getRandomBits(int numRandomBits) {
|
||||
ScalarBits = sizeof(Scalar) * CHAR_BIT
|
||||
};
|
||||
eigen_assert((numRandomBits >= 0) && (numRandomBits <= ScalarBits));
|
||||
const BitsType mask = BitsType(-1) >> (ScalarBits - numRandomBits);
|
||||
const BitsType mask = BitsType(-1) >> ((ScalarBits - numRandomBits) & (ScalarBits - 1));
|
||||
BitsType randomBits = BitsType(0);
|
||||
for (int shift = 0; shift < numRandomBits; shift += StdRandBits) {
|
||||
int r = std::rand();
|
||||
|
Loading…
x
Reference in New Issue
Block a user