about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Scherer <github35764891676564198441@oli-obk.de>2020-01-09 10:56:05 +0100
committerGitHub <noreply@github.com>2020-01-09 10:56:05 +0100
commite632940a41fe6d65bd677da85d87046dc5da5022 (patch)
treeb312c893a9036f2d80890f255d9b4e9ff7add8bc
parentd0b24e5ee292cc785401c880f21b690f5f3fa1d6 (diff)
downloadrust-e632940a41fe6d65bd677da85d87046dc5da5022.tar.gz
rust-e632940a41fe6d65bd677da85d87046dc5da5022.zip
Update src/librustc_mir/interpret/place.rs
Co-Authored-By: Ralf Jung <post@ralfj.de>
-rw-r--r--src/librustc_mir/interpret/place.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/librustc_mir/interpret/place.rs b/src/librustc_mir/interpret/place.rs
index 6428caa8fb0..87bb4c04b73 100644
--- a/src/librustc_mir/interpret/place.rs
+++ b/src/librustc_mir/interpret/place.rs
@@ -182,6 +182,7 @@ impl<'tcx, Tag> MPlaceTy<'tcx, Tag> {
     pub fn dangling(layout: TyLayout<'tcx>, cx: &impl HasDataLayout) -> Self {
         let align = layout.align.abi;
         let ptr = Scalar::from_uint(align.bytes(), cx.pointer_size());
+        // `Poison` this to make sure that the pointer value `ptr` is never observable by the program.
         MPlaceTy { mplace: MemPlace { ptr, align, meta: MemPlaceMeta::Poison }, layout }
     }