From c46185bea01190e54ffc672d5b2b13c8df5d8068 Mon Sep 17 00:00:00 2001 From: Raoul Strackx Date: Thu, 13 Oct 2022 18:58:25 +0200 Subject: [PATCH] Bugfix: keep TLS data in sync --- library/std/src/sys/sgx/abi/tls/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/std/src/sys/sgx/abi/tls/mod.rs b/library/std/src/sys/sgx/abi/tls/mod.rs index 13d96e9a633d3..09c4ab3d3e901 100644 --- a/library/std/src/sys/sgx/abi/tls/mod.rs +++ b/library/std/src/sys/sgx/abi/tls/mod.rs @@ -111,6 +111,7 @@ impl Tls { rtabort!("TLS limit exceeded") }; TLS_DESTRUCTOR[index].store(dtor.map_or(0, |f| f as usize), Ordering::Relaxed); + unsafe { Self::current() }.data[index].set(ptr::null_mut()); Key::from_index(index) }