Skip to content

Commit

Permalink
Actually use the poison value
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Jan 7, 2020
1 parent 29c372b commit d0b24e5
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/librustc_mir/interpret/place.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d0b24e5

Please sign in to comment.