@@ -105,9 +105,9 @@ impl<'tcx> TlsData<'tcx> {
105
105
match self . keys . get_mut ( & key) {
106
106
Some ( TlsEntry { data, .. } ) => {
107
107
match new_data {
108
- Some ( ptr ) => {
109
- trace ! ( "TLS key {} for thread {:?} stored: {:?}" , key, thread_id, ptr ) ;
110
- data. insert ( thread_id, ptr ) ;
108
+ Some ( scalar ) => {
109
+ trace ! ( "TLS key {} for thread {:?} stored: {:?}" , key, thread_id, scalar ) ;
110
+ data. insert ( thread_id, scalar ) ;
111
111
}
112
112
None => {
113
113
trace ! ( "TLS key {} for thread {:?} removed" , key, thread_id) ;
@@ -271,7 +271,7 @@ trait EvalContextPrivExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
271
271
if let Some ( ( instance, ptr, key) ) = dtor {
272
272
this. machine . tls . last_dtor_key . insert ( active_thread, key) ;
273
273
trace ! ( "Running TLS dtor {:?} on {:?} at {:?}" , instance, ptr, active_thread) ;
274
- assert ! ( !this. is_null( ptr) . unwrap( ) , "Data can't be NULL when dtor is called!" ) ;
274
+ assert ! ( !this. is_null( ptr) . unwrap( ) , "data can't be NULL when dtor is called!" ) ;
275
275
276
276
let ret_place = MPlaceTy :: dangling ( this. machine . layouts . unit , this) . into ( ) ;
277
277
this. call_function (
@@ -295,10 +295,12 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
295
295
296
296
/// Schedule an active thread's TLS destructor to run on the active thread.
297
297
/// Note that this function does not run the destructors itself, it just
298
- /// schedules them one by one each time it is called.
298
+ /// schedules them one by one each time it is called and reenables the
299
+ /// thread so that it can be executed normally by the main execution loop.
299
300
///
300
301
/// FIXME: we do not support yet deallocation of thread local statics.
301
- fn schedule_tls_dtors_for_active_thread ( & mut self ) -> InterpResult < ' tcx > {
302
+ /// Issue: https://github.com/rust-lang/miri/issues/1369
303
+ fn schedule_next_tls_dtor_for_active_thread ( & mut self ) -> InterpResult < ' tcx > {
302
304
let this = self . eval_context_mut ( ) ;
303
305
let active_thread = this. get_active_thread ( ) ?;
304
306
0 commit comments