From e632940a41fe6d65bd677da85d87046dc5da5022 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Thu, 9 Jan 2020 10:56:05 +0100 Subject: [PATCH] Update src/librustc_mir/interpret/place.rs Co-Authored-By: Ralf Jung --- src/librustc_mir/interpret/place.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_mir/interpret/place.rs b/src/librustc_mir/interpret/place.rs index 6428caa8fb0ed..87bb4c04b73ac 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 } }