Update src/librustc_mir/interpret/place.rs
Co-Authored-By: Ralf Jung <post@ralfj.de>
This commit is contained in:
parent
d0b24e5ee2
commit
e632940a41
1 changed files with 1 additions and 0 deletions
|
@ -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 }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue