@@ -43,9 +43,9 @@ pub enum MiriMemoryKind {
4343 C ,
4444 /// Windows `HeapAlloc` memory.
4545 WinHeap ,
46- /// Part of env var emulation .
46+ /// Memory for env vars and args, errno and other parts of the machine-managed environment .
4747 Env ,
48- /// Statics .
48+ /// Rust statics .
4949 Static ,
5050}
5151
@@ -296,19 +296,20 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
296296 id : AllocId ,
297297 alloc : Cow < ' b , Allocation > ,
298298 kind : Option < MemoryKind < Self :: MemoryKinds > > ,
299- ) -> Cow < ' b , Allocation < Self :: PointerTag , Self :: AllocExtra > > {
299+ ) -> ( Cow < ' b , Allocation < Self :: PointerTag , Self :: AllocExtra > > , Self :: PointerTag ) {
300300 let kind = kind. expect ( "we set our STATIC_KIND so this cannot be None" ) ;
301301 let alloc = alloc. into_owned ( ) ;
302- let stacks = if memory_extra. validate {
303- Some ( Stacks :: new_allocation (
302+ let ( stacks, base_tag ) = if memory_extra. validate {
303+ let ( stacks , base_tag ) = Stacks :: new_allocation (
304304 id,
305305 alloc. size ,
306306 Rc :: clone ( & memory_extra. stacked_borrows ) ,
307307 kind,
308- ) )
308+ ) ;
309+ ( Some ( stacks) , base_tag)
309310 } else {
310- // No stacks.
311- None
311+ // No stacks, no tag .
312+ ( None , Tag :: Untagged )
312313 } ;
313314 let mut stacked_borrows = memory_extra. stacked_borrows . borrow_mut ( ) ;
314315 let alloc: Allocation < Tag , Self :: AllocExtra > = alloc. with_tags_and_extra (
@@ -325,7 +326,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
325326 stacked_borrows : stacks,
326327 } ,
327328 ) ;
328- Cow :: Owned ( alloc)
329+ ( Cow :: Owned ( alloc) , base_tag )
329330 }
330331
331332 #[ inline( always) ]
0 commit comments