From 38104abf63fe70b63fe9d26de8ed3a8cab56f7b7 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 23 Jun 2019 20:18:30 +0200 Subject: [PATCH] expand comment --- src/librustc_mir/interpret/memory.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs index 8b72c367e9f..c3eec677a48 100644 --- a/src/librustc_mir/interpret/memory.rs +++ b/src/librustc_mir/interpret/memory.rs @@ -289,7 +289,8 @@ fn check_offset_align(offset: u64, align: Align) -> InterpResult<'static> { // Normalize to a `Pointer` if we definitely need one. let normalized = if size.bytes() == 0 { - // Can be an integer, just take what we got. + // Can be an integer, just take what we got. We do NOT `force_bits` here; + // if this is already a `Pointer` we want to do the bounds checks! sptr } else { // A "real" access, we must get a pointer. -- GitLab