@@ -224,7 +224,7 @@ pub struct AllocExtra {
224
224
/// Weak memory emulation via the use of store buffers,
225
225
/// this is only added if it is enabled.
226
226
pub weak_memory : Option < weak_memory:: AllocExtra > ,
227
- // pub real_pointer: u64 ,
227
+ pub real_pointer : * const u8 ,
228
228
}
229
229
230
230
/// Precomputed layouts of primitive types
@@ -698,16 +698,10 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
698
698
alloc : Cow < ' b , Allocation > ,
699
699
kind : Option < MemoryKind < Self :: MemoryKind > > ,
700
700
) -> InterpResult < ' tcx , Cow < ' b , Allocation < Self :: Provenance , Self :: AllocExtra > > > {
701
- let ( size, _, _) = ecx. get_alloc_info ( id) ;
702
- let fake_range = AllocRange { start : rustc_target:: abi:: Size :: ZERO , size : size} ;
703
- let ree = ecx. memory . alloc_map ( ) . get ( id) . unwrap ( ) . 1 . get_bytes_with_uninit_and_ptr ( ecx, fake_range) . unwrap ( ) ;
704
-
705
- // let bytes_ptr = alloc.get_bytes( ecx, fake_range);
706
- // unsafe {
707
- // if bytes_ptr.is_ok() {//&& id.0 > std::num::NonZeroU64::new(1600).unwrap(){
708
- // // println!("{:?}, {:?}", id, *(bytes_ptr.unwrap().as_ptr()));
709
- // }
710
- // }
701
+ let size = alloc. size ( ) ;
702
+ let alloc_range = AllocRange { start : rustc_target:: abi:: Size :: ZERO , size : size} ;
703
+ let alloc_bytes_ptr = alloc. get_bytes_with_uninit_and_ptr ( ecx, alloc_range) . unwrap ( ) . as_ptr ( ) ;
704
+
711
705
let kind = kind. expect ( "we set our STATIC_KIND so this cannot be None" ) ;
712
706
if ecx. machine . tracked_alloc_ids . contains ( & id) {
713
707
register_diagnostic ( NonHaltingDiagnostic :: CreatedAlloc (
@@ -745,14 +739,13 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'mir, 'tcx> {
745
739
} else {
746
740
None
747
741
} ;
748
- // println!("{:?}", ree.as_ptr() as u64);
749
742
let alloc: Allocation < Provenance , Self :: AllocExtra > = alloc. adjust_from_tcx (
750
743
& ecx. tcx ,
751
744
AllocExtra {
752
745
stacked_borrows : stacks. map ( RefCell :: new) ,
753
746
data_race : race_alloc,
754
747
weak_memory : buffer_alloc,
755
- // real_pointer: 0 ,
748
+ real_pointer : alloc_bytes_ptr ,
756
749
} ,
757
750
|ptr| ecx. global_base_pointer ( ptr) ,
758
751
) ?;
0 commit comments