Skip to content

Commit ac4f69b

Browse files
committed
miri: add public alloc_kind accessor
1 parent 0bb8935 commit ac4f69b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/librustc_mir/interpret/memory.rs

+4
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ impl<'a, 'tcx, M: Machine<'tcx>> Memory<'a, 'tcx, M> {
352352
.ok_or(EvalErrorKind::ExecuteMemory.into())
353353
}
354354

355+
pub fn get_alloc_kind(&self, id: AllocId) -> Option<MemoryKind<M::MemoryKinds>> {
356+
self.alloc_kind.get(&id).cloned()
357+
}
358+
355359
/// For debugging, print an allocation and all allocations it points to, recursively.
356360
pub fn dump_alloc(&self, id: AllocId) {
357361
self.dump_allocs(vec![id]);

0 commit comments

Comments
 (0)