Skip to content
Permalink
Browse files

Actually use the poison value

  • Loading branch information
oli-obk committed Jan 7, 2020
1 parent 29c372b commit d0b24e5ee292cc785401c880f21b690f5f3fa1d6
Showing with 3 additions and 7 deletions.
  1. +3 −7 src/librustc_mir/interpret/place.rs
@@ -180,13 +180,9 @@ impl<'tcx, Tag> MPlaceTy<'tcx, Tag> {
/// Produces a MemPlace that works for ZST but nothing else
#[inline]
pub fn dangling(layout: TyLayout<'tcx>, cx: &impl HasDataLayout) -> Self {
MPlaceTy {
mplace: MemPlace::from_scalar_ptr(
Scalar::from_uint(layout.align.abi.bytes(), cx.pointer_size()),
layout.align.abi,
),
layout,
}
let align = layout.align.abi;
let ptr = Scalar::from_uint(align.bytes(), cx.pointer_size());
MPlaceTy { mplace: MemPlace { ptr, align, meta: MemPlaceMeta::Poison }, layout }
}

/// Replace ptr tag, maintain vtable tag (if any)

0 comments on commit d0b24e5

Please sign in to comment.
You can’t perform that action at this time.