add method to get absolute address of a pointer (useful only for Miri)
This commit is contained in:
parent
c9e568f72e
commit
3236092503
3 changed files with 14 additions and 6 deletions
|
@ -207,6 +207,16 @@ impl<Tag> Pointer<Option<Tag>> {
|
|||
None => Err(self.offset),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns the absolute address the pointer points to.
|
||||
/// Only works if Tag::OFFSET_IS_ADDR is true!
|
||||
pub fn addr(self) -> Size
|
||||
where
|
||||
Tag: Provenance,
|
||||
{
|
||||
assert!(Tag::OFFSET_IS_ADDR);
|
||||
self.offset
|
||||
}
|
||||
}
|
||||
|
||||
impl<Tag> Pointer<Option<Tag>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue