Skip to content

Commit c268ee2

Browse files
m-ou-seRalfJung
andauthored
Add note about use of force_ptr in futex implementation.
Co-authored-by: Ralf Jung <[email protected]>
1 parent dfcb46a commit c268ee2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/shims/posix/linux/sync.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ pub fn futex<'tcx>(
3030

3131
// The raw pointer value is used to identify the mutex.
3232
// Not all mutex operations actually read from this address or even require this address to exist.
33+
// This will make FUTEX_WAKE fail on an integer cast to a pointer. But FUTEX_WAIT on
34+
// such a pointer can never work anyway, so that seems fine.
3335
let futex_ptr = this.force_ptr(addr.to_scalar()?)?;
3436

3537
let thread = this.get_active_thread();

0 commit comments

Comments
 (0)