@@ -43,9 +43,9 @@ pub enum MiriMemoryKind {
43
43
C ,
44
44
/// Windows `HeapAlloc` memory.
45
45
WinHeap ,
46
- /// Part of env var emulation .
46
+ /// Memory for env vars and args, errno and other parts of the machine-managed environment .
47
47
Env ,
48
- /// Statics .
48
+ /// Rust statics .
49
49
Static ,
50
50
}
51
51
@@ -296,19 +296,20 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
296
296
id : AllocId ,
297
297
alloc : Cow < ' b , Allocation > ,
298
298
kind : Option < MemoryKind < Self :: MemoryKinds > > ,
299
- ) -> Cow < ' b , Allocation < Self :: PointerTag , Self :: AllocExtra > > {
299
+ ) -> ( Cow < ' b , Allocation < Self :: PointerTag , Self :: AllocExtra > > , Self :: PointerTag ) {
300
300
let kind = kind. expect ( "we set our STATIC_KIND so this cannot be None" ) ;
301
301
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 (
304
304
id,
305
305
alloc. size ,
306
306
Rc :: clone ( & memory_extra. stacked_borrows ) ,
307
307
kind,
308
- ) )
308
+ ) ;
309
+ ( Some ( stacks) , base_tag)
309
310
} else {
310
- // No stacks.
311
- None
311
+ // No stacks, no tag .
312
+ ( None , Tag :: Untagged )
312
313
} ;
313
314
let mut stacked_borrows = memory_extra. stacked_borrows . borrow_mut ( ) ;
314
315
let alloc: Allocation < Tag , Self :: AllocExtra > = alloc. with_tags_and_extra (
@@ -325,7 +326,7 @@ impl<'mir, 'tcx> Machine<'mir, 'tcx> for Evaluator<'tcx> {
325
326
stacked_borrows : stacks,
326
327
} ,
327
328
) ;
328
- Cow :: Owned ( alloc)
329
+ ( Cow :: Owned ( alloc) , base_tag )
329
330
}
330
331
331
332
#[ inline( always) ]
0 commit comments