Skip to content

Commit b0c75d0

Browse files
authored
Use pointer::sub instead of pointer::offset. (#655)
This makes the code a little simpler.
1 parent 8a2ffa5 commit b0c75d0

File tree

1 file changed

+1
-1
lines changed
  • src/backend/linux_raw/runtime

1 file changed

+1
-1
lines changed

src/backend/linux_raw/runtime/tls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub(crate) fn startup_tls_info() -> StartupTlsInfo {
2929
unsafe {
3030
for phdr in phdrs {
3131
match phdr.p_type {
32-
PT_PHDR => base = phdrs.as_ptr().cast::<u8>().offset(-(phdr.p_vaddr as isize)),
32+
PT_PHDR => base = phdrs.as_ptr().cast::<u8>().sub(phdr.p_vaddr),
3333
PT_TLS => tls_phdr = phdr,
3434
PT_GNU_STACK => stack_size = phdr.p_memsz,
3535
_ => {}

0 commit comments

Comments
 (0)