Skip to content

Commit d0b24e5

Browse files
committed
Actually use the poison value
1 parent 29c372b commit d0b24e5

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/librustc_mir/interpret/place.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,9 @@ impl<'tcx, Tag> MPlaceTy<'tcx, Tag> {
180180
/// Produces a MemPlace that works for ZST but nothing else
181181
#[inline]
182182
pub fn dangling(layout: TyLayout<'tcx>, cx: &impl HasDataLayout) -> Self {
183-
MPlaceTy {
184-
mplace: MemPlace::from_scalar_ptr(
185-
Scalar::from_uint(layout.align.abi.bytes(), cx.pointer_size()),
186-
layout.align.abi,
187-
),
188-
layout,
189-
}
183+
let align = layout.align.abi;
184+
let ptr = Scalar::from_uint(align.bytes(), cx.pointer_size());
185+
MPlaceTy { mplace: MemPlace { ptr, align, meta: MemPlaceMeta::Poison }, layout }
190186
}
191187

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

0 commit comments

Comments
 (0)