Fix error with uninitialized index.

This commit is contained in:
Peter Pettersson 2013-04-22 20:33:06 +02:00
parent 7e9c41f81d
commit dffa589dd3
1 changed files with 2 additions and 0 deletions

View File

@ -31,6 +31,7 @@
RandomWELL512a_SSE2::RandomWELL512a_SSE2(int seed) RandomWELL512a_SSE2::RandomWELL512a_SSE2(int seed)
: index(0) : index(0)
, resultIndex(4)
{ {
srand(seed); srand(seed);
for (int i = 0; i < 16; ++i) for (int i = 0; i < 16; ++i)
@ -39,6 +40,7 @@ RandomWELL512a_SSE2::RandomWELL512a_SSE2(int seed)
RandomWELL512a_SSE2::RandomWELL512a_SSE2(unsigned *seed) RandomWELL512a_SSE2::RandomWELL512a_SSE2(unsigned *seed)
: index(0) : index(0)
, resultIndex(4)
{ {
for (int i = 0; i < 16; ++i) for (int i = 0; i < 16; ++i)
xmm_state[i] = _mm_set_epi32(seed[i + 48], seed[i + 32], seed[i + 16], seed[i]); xmm_state[i] = _mm_set_epi32(seed[i + 48], seed[i + 32], seed[i + 16], seed[i]);