@@ -316,8 +316,7 @@ where
316
316
Ok ( MPlaceTy { mplace, layout, align } )
317
317
}
318
318
319
- /// Take an operand, representing a pointer, and dereference it to a place -- that
320
- /// will always be a MemPlace. Lives in `place.rs` because it creates a place.
319
+ /// Take an operand, representing a pointer, and dereference it to a place.
321
320
#[ instrument( skip( self ) , level = "debug" ) ]
322
321
pub fn deref_operand (
323
322
& self ,
@@ -331,7 +330,7 @@ where
331
330
}
332
331
333
332
let mplace = self . ref_to_mplace ( & val) ?;
334
- self . check_mplace_access ( mplace, CheckInAllocMsg :: DerefTest ) ?;
333
+ self . check_mplace ( mplace) ?;
335
334
Ok ( mplace)
336
335
}
337
336
@@ -358,17 +357,18 @@ where
358
357
}
359
358
360
359
/// Check if this mplace is dereferenceable and sufficiently aligned.
361
- fn check_mplace_access (
362
- & self ,
363
- mplace : MPlaceTy < ' tcx , M :: Provenance > ,
364
- msg : CheckInAllocMsg ,
365
- ) -> InterpResult < ' tcx > {
360
+ pub fn check_mplace ( & self , mplace : MPlaceTy < ' tcx , M :: Provenance > ) -> InterpResult < ' tcx > {
366
361
let ( size, align) = self
367
362
. size_and_align_of_mplace ( & mplace) ?
368
363
. unwrap_or ( ( mplace. layout . size , mplace. layout . align . abi ) ) ;
369
364
assert ! ( mplace. align <= align, "dynamic alignment less strict than static one?" ) ;
370
365
let align = M :: enforce_alignment ( self ) . then_some ( align) ;
371
- self . check_ptr_access_align ( mplace. ptr , size, align. unwrap_or ( Align :: ONE ) , msg) ?;
366
+ self . check_ptr_access_align (
367
+ mplace. ptr ,
368
+ size,
369
+ align. unwrap_or ( Align :: ONE ) ,
370
+ CheckInAllocMsg :: DerefTest ,
371
+ ) ?;
372
372
Ok ( ( ) )
373
373
}
374
374
0 commit comments