Skip to content

Commit

Permalink
Update src/librustc_mir/interpret/place.rs
Browse files Browse the repository at this point in the history
Co-Authored-By: Ralf Jung <post@ralfj.de>
  • Loading branch information
oli-obk and RalfJung committed Jan 9, 2020
1 parent d0b24e5 commit e632940
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/librustc_mir/interpret/place.rs
Expand Up @@ -182,6 +182,7 @@ impl<'tcx, Tag> MPlaceTy<'tcx, Tag> {
pub fn dangling(layout: TyLayout<'tcx>, cx: &impl HasDataLayout) -> Self { pub fn dangling(layout: TyLayout<'tcx>, cx: &impl HasDataLayout) -> Self {
let align = layout.align.abi; let align = layout.align.abi;
let ptr = Scalar::from_uint(align.bytes(), cx.pointer_size()); 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 } MPlaceTy { mplace: MemPlace { ptr, align, meta: MemPlaceMeta::Poison }, layout }
} }


Expand Down

0 comments on commit e632940

Please sign in to comment.