Skip to content

Commit 427a079

Browse files
committed
kmc-solid: Use expose_addr and from_exposed_addr for pointer-integer casts
Pointer-integer casts are required for conversion between `EXINF` (ITRON task entry point parameter) and `*const ThreadInner`. Addresses the deny-level lint `fuzzy_provenance_casts`.
1 parent 8de4b13 commit 427a079

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/std/src/sys/itron/thread.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl Thread {
9191

9292
unsafe extern "C" fn trampoline(exinf: isize) {
9393
// Safety: `ThreadInner` is alive at this point
94-
let inner = unsafe { &*(exinf as *const ThreadInner) };
94+
let inner: &ThreadInner = unsafe { &*crate::ptr::from_exposed_addr(exinf as usize) };
9595

9696
// Safety: Since `trampoline` is called only once for each
9797
// `ThreadInner` and only `trampoline` touches `start`,
@@ -168,7 +168,7 @@ impl Thread {
168168
abi::acre_tsk(&abi::T_CTSK {
169169
// Activate this task immediately
170170
tskatr: abi::TA_ACT,
171-
exinf: inner_ptr as abi::EXINF,
171+
exinf: inner_ptr.expose_addr() as abi::EXINF,
172172
// The entry point
173173
task: Some(trampoline),
174174
// Inherit the calling task's base priority

0 commit comments

Comments
 (0)