@@ -200,7 +200,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
200200 kind : MemoryKind < M :: MemoryKind > ,
201201 ) -> InterpResult < ' static , Pointer < M :: PointerTag > > {
202202 let alloc = Allocation :: uninit ( size, align, M :: PANIC_ON_ALLOC_FAIL ) ?;
203- Ok ( self . allocate_with_ptr ( alloc, kind) )
203+ Ok ( self . allocate_raw_ptr ( alloc, kind) )
204204 }
205205
206206 pub fn allocate_bytes_ptr (
@@ -211,10 +211,10 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
211211 mutability : Mutability ,
212212 ) -> Pointer < M :: PointerTag > {
213213 let alloc = Allocation :: from_bytes ( bytes, align, mutability) ;
214- self . allocate_with_ptr ( alloc, kind)
214+ self . allocate_raw_ptr ( alloc, kind)
215215 }
216216
217- pub fn allocate_with_ptr (
217+ pub fn allocate_raw_ptr (
218218 & mut self ,
219219 alloc : Allocation ,
220220 kind : MemoryKind < M :: MemoryKind > ,
@@ -238,7 +238,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
238238 new_align : Align ,
239239 kind : MemoryKind < M :: MemoryKind > ,
240240 ) -> InterpResult < ' tcx , Pointer < M :: PointerTag > > {
241- let ( alloc_id, offset, ptr) = self . ptr_get_alloc ( ptr) ?;
241+ let ( alloc_id, offset, ptr) = self . ptr_get_alloc_id ( ptr) ?;
242242 if offset. bytes ( ) != 0 {
243243 throw_ub_format ! (
244244 "reallocating {:?} which does not point to the beginning of an object" ,
@@ -274,7 +274,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
274274 old_size_and_align : Option < ( Size , Align ) > ,
275275 kind : MemoryKind < M :: MemoryKind > ,
276276 ) -> InterpResult < ' tcx > {
277- let ( alloc_id, offset, ptr) = self . ptr_get_alloc ( ptr) ?;
277+ let ( alloc_id, offset, ptr) = self . ptr_get_alloc_id ( ptr) ?;
278278 trace ! ( "deallocating: {}" , alloc_id) ;
279279
280280 if offset. bytes ( ) != 0 {
@@ -419,7 +419,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
419419 }
420420 }
421421
422- Ok ( match self . ptr_try_get_alloc ( ptr) {
422+ Ok ( match self . ptr_try_get_alloc_id ( ptr) {
423423 Err ( addr) => {
424424 // We couldn't get a proper allocation. This is only okay if the access size is 0,
425425 // and the address is not null.
@@ -731,7 +731,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
731731 ptr : Pointer < Option < M :: PointerTag > > ,
732732 ) -> InterpResult < ' tcx , FnVal < ' tcx , M :: ExtraFnVal > > {
733733 trace ! ( "get_fn({:?})" , ptr) ;
734- let ( alloc_id, offset, _ptr) = self . ptr_get_alloc ( ptr) ?;
734+ let ( alloc_id, offset, _ptr) = self . ptr_get_alloc_id ( ptr) ?;
735735 if offset. bytes ( ) != 0 {
736736 throw_ub ! ( InvalidFunctionPointer ( Pointer :: new( alloc_id, offset) ) )
737737 }
@@ -1125,7 +1125,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
11251125 Err ( _) => {
11261126 // Can only happen during CTFE.
11271127 let ptr = self . scalar_to_ptr ( scalar) ;
1128- match self . ptr_try_get_alloc ( ptr) {
1128+ match self . ptr_try_get_alloc_id ( ptr) {
11291129 Ok ( ( alloc_id, offset, _) ) => {
11301130 let ( size, _align) = self
11311131 . get_alloc_size_and_align ( alloc_id, AllocCheck :: MaybeDead )
@@ -1142,7 +1142,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
11421142
11431143 /// Turning a "maybe pointer" into a proper pointer (and some information
11441144 /// about where it points), or an absolute address.
1145- pub fn ptr_try_get_alloc (
1145+ pub fn ptr_try_get_alloc_id (
11461146 & self ,
11471147 ptr : Pointer < Option < M :: PointerTag > > ,
11481148 ) -> Result < ( AllocId , Size , Pointer < M :: PointerTag > ) , u64 > {
@@ -1157,11 +1157,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
11571157
11581158 /// Turning a "maybe pointer" into a proper pointer (and some information about where it points).
11591159 #[ inline( always) ]
1160- pub fn ptr_get_alloc (
1160+ pub fn ptr_get_alloc_id (
11611161 & self ,
11621162 ptr : Pointer < Option < M :: PointerTag > > ,
11631163 ) -> InterpResult < ' tcx , ( AllocId , Size , Pointer < M :: PointerTag > ) > {
1164- self . ptr_try_get_alloc ( ptr) . map_err ( |offset| {
1164+ self . ptr_try_get_alloc_id ( ptr) . map_err ( |offset| {
11651165 err_ub ! ( DanglingIntPointer ( offset, CheckInAllocMsg :: InboundsTest ) ) . into ( )
11661166 } )
11671167 }
0 commit comments