@@ -55,25 +55,23 @@ pub fn futex<'tcx>(
55
55
op if op & !futex_realtime == futex_wait || op & !futex_realtime == futex_wait_bitset => {
56
56
let wait_bitset = op & !futex_realtime == futex_wait_bitset;
57
57
58
- let bitset;
59
-
60
- if wait_bitset {
58
+ let bitset = if wait_bitset {
61
59
if args. len ( ) != 7 {
62
60
throw_ub_format ! (
63
61
"incorrect number of arguments for `futex` syscall with `op=FUTEX_WAIT_BITSET`: got {}, expected 7" ,
64
62
args. len( )
65
63
) ;
66
64
}
67
- bitset = this. read_scalar ( & args[ 6 ] ) ?. to_u32 ( ) ?;
65
+ this. read_scalar ( & args[ 6 ] ) ?. to_u32 ( ) ?
68
66
} else {
69
67
if args. len ( ) < 5 {
70
68
throw_ub_format ! (
71
69
"incorrect number of arguments for `futex` syscall with `op=FUTEX_WAIT`: got {}, expected at least 5" ,
72
70
args. len( )
73
71
) ;
74
72
}
75
- bitset = u32:: MAX ;
76
- }
73
+ u32:: MAX
74
+ } ;
77
75
78
76
if bitset == 0 {
79
77
let einval = this. eval_libc ( "EINVAL" ) ?;
@@ -182,18 +180,17 @@ pub fn futex<'tcx>(
182
180
// FUTEX_WAKE_BITSET: (int *addr, int op = FUTEX_WAKE, int val, const timespect *_unused, int *_unused, unsigned int bitset)
183
181
// Same as FUTEX_WAKE, but allows you to specify a bitset to select which threads to wake up.
184
182
op if op == futex_wake || op == futex_wake_bitset => {
185
- let bitset;
186
- if op == futex_wake_bitset {
183
+ let bitset = if op == futex_wake_bitset {
187
184
if args. len ( ) != 7 {
188
185
throw_ub_format ! (
189
186
"incorrect number of arguments for `futex` syscall with `op=FUTEX_WAKE_BITSET`: got {}, expected 7" ,
190
187
args. len( )
191
188
) ;
192
189
}
193
- bitset = this. read_scalar ( & args[ 6 ] ) ?. to_u32 ( ) ?;
190
+ this. read_scalar ( & args[ 6 ] ) ?. to_u32 ( ) ?
194
191
} else {
195
- bitset = u32:: MAX ;
196
- }
192
+ u32:: MAX
193
+ } ;
197
194
if bitset == 0 {
198
195
let einval = this. eval_libc ( "EINVAL" ) ?;
199
196
this. set_last_error ( einval) ?;
0 commit comments