Skip to content

Commit 9b57313

Browse files
committed
also treat CallerLocation and Machine memory as properly tagged
1 parent efd582c commit 9b57313

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/stacked_borrows.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -504,22 +504,23 @@ impl Stacks {
504504
// `Global` memory can be referenced by global pointers from `tcx`.
505505
// Thus we call `global_base_ptr` such that the global pointers get the same tag
506506
// as what we use here.
507-
// `ExternStatic` is used for extern statics, and thus must also be listed here.
508-
// `Env` we list because we can get away with precise tracking there.
507+
// `ExternStatic` is used for extern statics, so the same reasoning applies.
508+
// The others are various forms of machine-managed special global memory, and we can get
509+
// away with precise tracking there.
509510
// The base pointer is not unique, so the base permission is `SharedReadWrite`.
510-
MemoryKind::Machine(
511+
MemoryKind::CallerLocation
512+
| MemoryKind::Machine(
511513
MiriMemoryKind::Global
512514
| MiriMemoryKind::ExternStatic
513515
| MiriMemoryKind::Tls
514-
| MiriMemoryKind::Env,
516+
| MiriMemoryKind::Env
517+
| MiriMemoryKind::Machine,
515518
) => (extra.global_base_ptr(id), Permission::SharedReadWrite),
516-
// Everything else we only track precisely when raw pointers are tagged, for now.
517-
MemoryKind::CallerLocation
518-
| MemoryKind::Machine(
519+
// Heap allocations we only track precisely when raw pointers are tagged, for now.
520+
MemoryKind::Machine(
519521
MiriMemoryKind::Rust
520522
| MiriMemoryKind::C
521-
| MiriMemoryKind::WinHeap
522-
| MiriMemoryKind::Machine,
523+
| MiriMemoryKind::WinHeap,
523524
) => {
524525
let tag =
525526
if extra.track_raw { Tag::Tagged(extra.new_ptr()) } else { Tag::Untagged };

0 commit comments

Comments
 (0)