@@ -857,6 +857,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> std::fmt::Debug for DumpAllocs<'a,
857
857
858
858
/// Reading and writing.
859
859
impl < ' tcx , ' a , Tag : Provenance , Extra > AllocRefMut < ' a , ' tcx , Tag , Extra > {
860
+ /// `range` is relative to this allocation reference, not the base of the allocation.
860
861
pub fn write_scalar (
861
862
& mut self ,
862
863
range : AllocRange ,
@@ -870,6 +871,7 @@ impl<'tcx, 'a, Tag: Provenance, Extra> AllocRefMut<'a, 'tcx, Tag, Extra> {
870
871
. map_err ( |e| e. to_interp_error ( self . alloc_id ) ) ?)
871
872
}
872
873
874
+ /// `offset` is relative to this allocation reference, not the base of the allocation.
873
875
pub fn write_ptr_sized (
874
876
& mut self ,
875
877
offset : Size ,
@@ -888,6 +890,7 @@ impl<'tcx, 'a, Tag: Provenance, Extra> AllocRefMut<'a, 'tcx, Tag, Extra> {
888
890
}
889
891
890
892
impl < ' tcx , ' a , Tag : Provenance , Extra > AllocRef < ' a , ' tcx , Tag , Extra > {
893
+ /// `range` is relative to this allocation reference, not the base of the allocation.
891
894
pub fn read_scalar (
892
895
& self ,
893
896
range : AllocRange ,
@@ -902,21 +905,20 @@ impl<'tcx, 'a, Tag: Provenance, Extra> AllocRef<'a, 'tcx, Tag, Extra> {
902
905
Ok ( res)
903
906
}
904
907
905
- pub fn read_integer (
906
- & self ,
907
- offset : Size ,
908
- size : Size ,
909
- ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
910
- self . read_scalar ( alloc_range ( offset, size) , /*read_provenance*/ false )
908
+ /// `range` is relative to this allocation reference, not the base of the allocation.
909
+ pub fn read_integer ( & self , range : AllocRange ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
910
+ self . read_scalar ( range, /*read_provenance*/ false )
911
911
}
912
912
913
+ /// `offset` is relative to this allocation reference, not the base of the allocation.
913
914
pub fn read_pointer ( & self , offset : Size ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
914
915
self . read_scalar (
915
916
alloc_range ( offset, self . tcx . data_layout ( ) . pointer_size ) ,
916
917
/*read_provenance*/ true ,
917
918
)
918
919
}
919
920
921
+ /// `range` is relative to this allocation reference, not the base of the allocation.
920
922
pub fn check_bytes (
921
923
& self ,
922
924
range : AllocRange ,
0 commit comments