We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
./v -cc clang -cflags -fsanitize=alignment -cflags -fno-sanitize-recover=all test vlib/rand/
1 parent 8b20f61 commit b075f9fCopy full SHA for b075f9f
1 file changed
vlib/rand/rand.c.v
@@ -195,6 +195,12 @@ fn read_32(mut rng PRNG, mut buf []u8) {
195
@[direct_array_access]
196
fn read_64(mut rng PRNG, mut buf []u8) {
197
p64 := unsafe { &u64(buf.data) }
198
+ if u64(p64) & 0xF != 0 {
199
+ for i in 0 .. buf.len {
200
+ buf[i] = rng.u8()
201
+ }
202
+ return
203
204
u64s := buf.len / 8
205
for i in 0 .. u64s {
206
unsafe {
0 commit comments