We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9358d09 commit 2fa5808Copy full SHA for 2fa5808
library/std/src/sys/sgx/abi/thread.rs
@@ -7,7 +7,11 @@ use fortanix_sgx_abi::Tcs;
7
#[unstable(feature = "sgx_platform", issue = "56975")]
8
pub fn current() -> Tcs {
9
extern "C" {
10
- fn get_tcs_addr() -> Tcs;
+ fn get_tcs_addr() -> *mut u8;
11
+ }
12
+ let addr = unsafe { get_tcs_addr() };
13
+ match Tcs::new(addr) {
14
+ Some(tcs) => tcs,
15
+ None => rtabort!("TCS must not be placed at address zero (this is a linker error)"),
16
}
- unsafe { get_tcs_addr() }
17
0 commit comments