@@ -715,9 +715,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
715
715
}
716
716
717
717
/// Dereference a pointer operand to a place using `layout` instead of the pointer's declared type
718
- fn deref_operand_as (
718
+ fn deref_pointer_as (
719
719
& self ,
720
- op : & OpTy < ' tcx , Provenance > ,
720
+ op : & impl Readable < ' tcx , Provenance > ,
721
721
layout : TyAndLayout < ' tcx > ,
722
722
) -> InterpResult < ' tcx , MPlaceTy < ' tcx , Provenance > > {
723
723
let this = self . eval_context_ref ( ) ;
@@ -746,15 +746,15 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
746
746
}
747
747
748
748
/// Calculates the MPlaceTy given the offset and layout of an access on an operand
749
- fn deref_operand_and_offset (
749
+ fn deref_pointer_and_offset (
750
750
& self ,
751
- op : & OpTy < ' tcx , Provenance > ,
751
+ op : & impl Readable < ' tcx , Provenance > ,
752
752
offset : u64 ,
753
753
base_layout : TyAndLayout < ' tcx > ,
754
754
value_layout : TyAndLayout < ' tcx > ,
755
755
) -> InterpResult < ' tcx , MPlaceTy < ' tcx , Provenance > > {
756
756
let this = self . eval_context_ref ( ) ;
757
- let op_place = this. deref_operand_as ( op, base_layout) ?;
757
+ let op_place = this. deref_pointer_as ( op, base_layout) ?;
758
758
let offset = Size :: from_bytes ( offset) ;
759
759
760
760
// Ensure that the access is within bounds.
@@ -763,28 +763,28 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
763
763
Ok ( value_place)
764
764
}
765
765
766
- fn read_scalar_at_offset (
766
+ fn deref_pointer_and_read (
767
767
& self ,
768
- op : & OpTy < ' tcx , Provenance > ,
768
+ op : & impl Readable < ' tcx , Provenance > ,
769
769
offset : u64 ,
770
770
base_layout : TyAndLayout < ' tcx > ,
771
771
value_layout : TyAndLayout < ' tcx > ,
772
772
) -> InterpResult < ' tcx , Scalar < Provenance > > {
773
773
let this = self . eval_context_ref ( ) ;
774
- let value_place = this. deref_operand_and_offset ( op, offset, base_layout, value_layout) ?;
774
+ let value_place = this. deref_pointer_and_offset ( op, offset, base_layout, value_layout) ?;
775
775
this. read_scalar ( & value_place)
776
776
}
777
777
778
- fn write_scalar_at_offset (
778
+ fn deref_pointer_and_write (
779
779
& mut self ,
780
- op : & OpTy < ' tcx , Provenance > ,
780
+ op : & impl Readable < ' tcx , Provenance > ,
781
781
offset : u64 ,
782
782
value : impl Into < Scalar < Provenance > > ,
783
783
base_layout : TyAndLayout < ' tcx > ,
784
784
value_layout : TyAndLayout < ' tcx > ,
785
785
) -> InterpResult < ' tcx , ( ) > {
786
786
let this = self . eval_context_mut ( ) ;
787
- let value_place = this. deref_operand_and_offset ( op, offset, base_layout, value_layout) ?;
787
+ let value_place = this. deref_pointer_and_offset ( op, offset, base_layout, value_layout) ?;
788
788
this. write_scalar ( value, & value_place)
789
789
}
790
790
0 commit comments