Skip to content
Permalink
Browse files

Make `Allocation` stable hash robust

  • Loading branch information...
oli-obk committed Jun 13, 2019
1 parent 4399299 commit e951d8ec0b9055c333485c0f68024b8371f4fa61
Showing with 9 additions and 5 deletions.
  1. +9 −5 src/librustc/ich/impls_ty.rs
@@ -175,13 +175,17 @@ impl<'a> HashStable<StableHashingContext<'a>> for mir::interpret::Allocation {
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher<W>,
) {
self.bytes.hash_stable(hcx, hasher);
for reloc in self.relocations.iter() {
let mir::interpret::Allocation {
bytes, relocations, undef_mask, align, mutability,
extra: _,
} = self;
bytes.hash_stable(hcx, hasher);
for reloc in relocations.iter() {
reloc.hash_stable(hcx, hasher);
}
self.undef_mask.hash_stable(hcx, hasher);
self.align.hash_stable(hcx, hasher);
self.mutability.hash_stable(hcx, hasher);
undef_mask.hash_stable(hcx, hasher);
align.hash_stable(hcx, hasher);
mutability.hash_stable(hcx, hasher);
}
}

0 comments on commit e951d8e

Please sign in to comment.
You can’t perform that action at this time.