diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-12-24 17:38:22 -0500 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-12-24 17:38:22 -0500 |
| commit | 6891388e661c2bbf965a330ff73bf8c08a7dbf7d (patch) | |
| tree | ff2f518c1dfdb558a162c73b3ee3f2a0b44d5adc /src/libstd/sys/sgx | |
| parent | 48291a9dda821a81957b44034572c0ec62728f35 (diff) | |
| download | rust-6891388e661c2bbf965a330ff73bf8c08a7dbf7d.tar.gz rust-6891388e661c2bbf965a330ff73bf8c08a7dbf7d.zip | |
x.py fmt after previous deignore
Diffstat (limited to 'src/libstd/sys/sgx')
| -rw-r--r-- | src/libstd/sys/sgx/abi/mem.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libstd/sys/sgx/abi/mem.rs b/src/libstd/sys/sgx/abi/mem.rs index d9051733da2..500e62b1cb5 100644 --- a/src/libstd/sys/sgx/abi/mem.rs +++ b/src/libstd/sys/sgx/abi/mem.rs @@ -10,7 +10,7 @@ pub(crate) unsafe fn rel_ptr_mut<T>(offset: u64) -> *mut T { (image_base() + offset) as *mut T } -extern { +extern "C" { static ENCLAVE_SIZE: usize; } @@ -33,8 +33,7 @@ pub fn image_base() -> u64 { pub fn is_enclave_range(p: *const u8, len: usize) -> bool { let start = p as u64; let end = start + (len as u64); - start >= image_base() && - end <= image_base() + (unsafe { ENCLAVE_SIZE } as u64) // unsafe ok: link-time constant + start >= image_base() && end <= image_base() + (unsafe { ENCLAVE_SIZE } as u64) // unsafe ok: link-time constant } /// Returns `true` if the specified memory range is in userspace. @@ -44,6 +43,5 @@ pub fn is_enclave_range(p: *const u8, len: usize) -> bool { pub fn is_user_range(p: *const u8, len: usize) -> bool { let start = p as u64; let end = start + (len as u64); - end <= image_base() || - start >= image_base() + (unsafe { ENCLAVE_SIZE } as u64) // unsafe ok: link-time constant + end <= image_base() || start >= image_base() + (unsafe { ENCLAVE_SIZE } as u64) // unsafe ok: link-time constant } |
