diff options
| -rw-r--r-- | src/librustc/mir/interpret/allocation.rs | 5 | ||||
| -rw-r--r-- | src/librustc_mir/interpret/memory.rs | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/librustc/mir/interpret/allocation.rs b/src/librustc/mir/interpret/allocation.rs index bfbfffeb3b8..d3f87f16313 100644 --- a/src/librustc/mir/interpret/allocation.rs +++ b/src/librustc/mir/interpret/allocation.rs @@ -143,6 +143,11 @@ impl<Tag, Extra> Allocation<Tag, Extra> { pub fn inspect_with_undef_and_ptr_outside_interpreter(&self, range: Range<usize>) -> &[u8] { &self.bytes[range] } + + /// View the undef mask. + pub fn undef_mask(&self) -> &UndefMask { + &self.undef_mask + } } impl<'tcx> rustc_serialize::UseSpecializedDecodable for &'tcx Allocation {} diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs index 15180265ad2..f7576a41e0f 100644 --- a/src/librustc_mir/interpret/memory.rs +++ b/src/librustc_mir/interpret/memory.rs @@ -653,7 +653,7 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> { } relocations.push((i, target_id)); } - if alloc.undef_mask.is_range_defined(i, i + Size::from_bytes(1)).is_ok() { + if alloc.undef_mask().is_range_defined(i, i + Size::from_bytes(1)).is_ok() { // this `as usize` is fine, since `i` came from a `usize` let i = i.bytes() as usize; |
