Unverified Commit 506a0e80 authored by Tom Almeida's avatar Tom Almeida
Browse files

stream: Index the remaining tail as a pointer instead of an array

This was causing issues for miri because array indexing only marks a
single byte for RW access, but the call to `copy_to_nonoverlapping`
could end up modifying up to 8 bytes.

Closes: #12
parent 1d067e51
......@@ -57,7 +57,7 @@ impl SeaHasher {
unsafe {
let mut this = self.tail.to_le_bytes();
let mut ptr = bytes.as_ptr();
ptr.copy_to_nonoverlapping(&mut this[self.ntail], copied);
ptr.copy_to_nonoverlapping(this.as_mut_ptr().add(self.ntail), copied);
// It will be at most 8
if copied + self.ntail != 8 {
self.ntail += copied;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment