Rollup merge of #49625 - bjorn3:miri_access_memory_kind, r=oli-obk

miri: add public alloc_kind accessor
This commit is contained in:
kennytm 2018-04-05 02:05:02 +08:00
commit 391959feb9
No known key found for this signature in database
GPG key ID: FEF6C8051D0E013C

View file

@ -328,6 +328,10 @@ impl<'a, 'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
.ok_or(EvalErrorKind::ExecuteMemory.into())
}
pub fn get_alloc_kind(&self, id: AllocId) -> Option<MemoryKind<M::MemoryKinds>> {
self.alloc_kind.get(&id).cloned()
}
/// For debugging, print an allocation and all allocations it points to, recursively.
pub fn dump_alloc(&self, id: AllocId) {
self.dump_allocs(vec![id]);