1
Fork 0

Update src/librustc_mir/interpret/place.rs

Co-Authored-By: Ralf Jung <post@ralfj.de>
This commit is contained in:
Oliver Scherer 2020-01-09 10:56:05 +01:00 committed by GitHub
parent d0b24e5ee2
commit e632940a41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 }
}