@@ -877,9 +877,17 @@ impl<'tcx, 'a, Tag: Provenance, Extra> AllocRefMut<'a, 'tcx, Tag, Extra> {
877
877
range : AllocRange ,
878
878
val : ScalarMaybeUninit < Tag > ,
879
879
) -> InterpResult < ' tcx > {
880
+ let range = self . range . subrange ( range) ;
881
+ debug ! (
882
+ "write_scalar in {} at {:#x}, size {}: {:?}" ,
883
+ self . alloc_id,
884
+ range. start. bytes( ) ,
885
+ range. size. bytes( ) ,
886
+ val
887
+ ) ;
880
888
Ok ( self
881
889
. alloc
882
- . write_scalar ( & self . tcx , self . range . subrange ( range ) , val)
890
+ . write_scalar ( & self . tcx , range, val)
883
891
. map_err ( |e| e. to_interp_error ( self . alloc_id ) ) ?)
884
892
}
885
893
@@ -899,10 +907,19 @@ impl<'tcx, 'a, Tag: Provenance, Extra> AllocRefMut<'a, 'tcx, Tag, Extra> {
899
907
900
908
impl < ' tcx , ' a , Tag : Provenance , Extra > AllocRef < ' a , ' tcx , Tag , Extra > {
901
909
pub fn read_scalar ( & self , range : AllocRange ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
902
- Ok ( self
910
+ let range = self . range . subrange ( range) ;
911
+ let res = self
903
912
. alloc
904
- . read_scalar ( & self . tcx , self . range . subrange ( range) )
905
- . map_err ( |e| e. to_interp_error ( self . alloc_id ) ) ?)
913
+ . read_scalar ( & self . tcx , range)
914
+ . map_err ( |e| e. to_interp_error ( self . alloc_id ) ) ?;
915
+ debug ! (
916
+ "read_scalar in {} at {:#x}, size {}: {:?}" ,
917
+ self . alloc_id,
918
+ range. start. bytes( ) ,
919
+ range. size. bytes( ) ,
920
+ res
921
+ ) ;
922
+ Ok ( res)
906
923
}
907
924
908
925
pub fn read_ptr_sized ( & self , offset : Size ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
0 commit comments