@@ -35,7 +35,7 @@ pub struct Allocation<Tag=(),Extra=()> {
35
35
/// Only the first byte of a pointer is inserted into the map; i.e.,
36
36
/// every entry in this map applies to `pointer_size` consecutive bytes starting
37
37
/// at the given offset.
38
- pub relocations : Relocations < Tag > ,
38
+ relocations : Relocations < Tag > ,
39
39
/// Denotes which part of this allocation is initialized.
40
40
undef_mask : UndefMask ,
41
41
/// The size of the allocation. Currently, must always equal `bytes.len()`.
@@ -148,6 +148,11 @@ impl<Tag, Extra> Allocation<Tag, Extra> {
148
148
pub fn undef_mask ( & self ) -> & UndefMask {
149
149
& self . undef_mask
150
150
}
151
+
152
+ /// Returns the relocation list.
153
+ pub fn relocations ( & self ) -> & Relocations < Tag > {
154
+ & self . relocations
155
+ }
151
156
}
152
157
153
158
impl < ' tcx > rustc_serialize:: UseSpecializedDecodable for & ' tcx Allocation { }
@@ -459,7 +464,7 @@ impl<'tcx, Tag: Copy, Extra: AllocationExtra<Tag>> Allocation<Tag, Extra> {
459
464
/// Relocations
460
465
impl < ' tcx , Tag : Copy , Extra > Allocation < Tag , Extra > {
461
466
/// Returns all relocations overlapping with the given ptr-offset pair.
462
- pub fn relocations (
467
+ pub fn get_relocations (
463
468
& self ,
464
469
cx : & impl HasDataLayout ,
465
470
ptr : Pointer < Tag > ,
@@ -480,7 +485,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
480
485
ptr : Pointer < Tag > ,
481
486
size : Size ,
482
487
) -> InterpResult < ' tcx > {
483
- if self . relocations ( cx, ptr, size) . is_empty ( ) {
488
+ if self . get_relocations ( cx, ptr, size) . is_empty ( ) {
484
489
Ok ( ( ) )
485
490
} else {
486
491
throw_unsup ! ( ReadPointerAsBytes )
@@ -502,7 +507,7 @@ impl<'tcx, Tag: Copy, Extra> Allocation<Tag, Extra> {
502
507
// Find the start and end of the given range and its outermost relocations.
503
508
let ( first, last) = {
504
509
// Find all relocations overlapping the given range.
505
- let relocations = self . relocations ( cx, ptr, size) ;
510
+ let relocations = self . get_relocations ( cx, ptr, size) ;
506
511
if relocations. is_empty ( ) {
507
512
return Ok ( ( ) ) ;
508
513
}
0 commit comments