-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
this._z is used uninitialized in MersenneTwisterEngine.opCall #6
Comments
Note that the effect is unobservable because the variate generated is never used ( |
Further note: my own benchmarking of this suggests that performance actually improves slightly if
Happy to submit a patch with that solution if it would be acceptable. |
... with a side benefit being that |
_z is not |
Please check checksums |
The only reason to init _z is CTFE-able Mt, will init it with zero |
Done 5a5e66e |
The
_z
field of theMersenneTwisterEngine
is uninitialized on struct creation:mir-random/source/mir/random/engine/mersenne_twister.d
Line 107 in b518dbb
The constructor does not touch it directly, but calls
popFront()
, where in this first call,_z
is used to set the value ofz
without_z
itself having been initialized first:mir-random/source/mir/random/engine/mersenne_twister.d
Line 153 in b518dbb
Presumably the intention/expectation is that
_z
should be initialized todata[index]
in the constructor?The text was updated successfully, but these errors were encountered: