File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
154
154
. unwrap ( ) ;
155
155
156
156
// Detect mismatches between the flags and sizes used on this address
157
- // by comparing with the parameters stored with the first waiter.
157
+ // by comparing it with the parameters used by the other waiters in
158
+ // the current list. If the list is currently empty, update those
159
+ // parameters.
158
160
if futex. futex . waiters ( ) == 0 {
159
161
futex. size . set ( size) ;
160
162
futex. shared . set ( is_shared) ;
@@ -246,7 +248,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
246
248
if futex. futex . waiters ( ) == 0 {
247
249
this. set_last_error_and_return ( LibcError ( "ENOENT" ) , dest) ?;
248
250
return interp_ok ( ( ) ) ;
249
- // Detect mismatches between the flags and sizes used on this address.
251
+ // If there are waiters in the queue, they have all used the parameters
252
+ // stored in `futex` (we check this in `os_sync_wait_on_address` above).
253
+ // Detect mismatches between "our" parameters and the parameters used by
254
+ // the waiters and return an error in that case.
250
255
} else if futex. size . get ( ) != size || futex. shared . get ( ) != is_shared {
251
256
this. set_last_error_and_return ( LibcError ( "EINVAL" ) , dest) ?;
252
257
return interp_ok ( ( ) ) ;
You can’t perform that action at this time.
0 commit comments