Skip to content

Commit 68776d2

Browse files
m-ou-seRalfJung
andauthored
Add FIXME about type of addr in futex implementation.
Co-authored-by: Ralf Jung <[email protected]>
1 parent c268ee2 commit 68776d2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/shims/posix/linux/sync.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ pub fn futex<'tcx>(
7777
this.memory.check_ptr_access(addr.to_scalar()?, Size::from_bytes(4), Align::from_bytes(4).unwrap())?;
7878
// Read an `i32` through the pointer, regardless of any wrapper types.
7979
// It's not uncommon for `addr` to be passed as another type than `*mut i32`, such as `*const AtomicI32`.
80+
// FIXME: this fails if `addr` is not a pointer type.
8081
let futex_val = this.read_scalar_at_offset(addr.into(), 0, this.machine.layouts.i32)?.to_i32()?;
8182
if val == futex_val {
8283
// The value still matches, so we block the trait make it wait for FUTEX_WAKE.

0 commit comments

Comments
 (0)