Skip to content

Commit e546c43

Browse files
StrophoxRalfJung
andauthored
Comment dummy memory allocation for AllocKind::{Function, VTable}
Co-authored-by: Ralf Jung <post@ralfj.de>
1 parent 40571e8 commit e546c43

File tree

1 file changed

+1
-0
lines changed
  • src/tools/miri/src/alloc_addresses

1 file changed

+1
-0
lines changed

src/tools/miri/src/alloc_addresses/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
191191
}
192192
}
193193
AllocKind::Function | AllocKind::VTable => {
194+
// Allocate some dummy memory to get a unique address for this function/vtable.
194195
let alloc_bytes = MiriAllocBytes::from_bytes(&[0u8; 1], Align::from_bytes(1).unwrap());
195196
let addr = alloc_bytes.as_ptr().addr().try_into().unwrap();
196197
// Leak this.

0 commit comments

Comments
 (0)