@@ -25,7 +25,7 @@ fn get_at_offset<'mir, 'tcx: 'mir>(
25
25
offset : u64 ,
26
26
layout : TyAndLayout < ' tcx > ,
27
27
min_size : u64 ,
28
- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
28
+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
29
29
// Ensure that the following read at an offset to the attr pointer is within bounds
30
30
assert_ptr_target_min_size ( ecx, op, min_size) ?;
31
31
let op_place = ecx. deref_operand ( op) ?;
@@ -37,7 +37,7 @@ fn set_at_offset<'mir, 'tcx: 'mir>(
37
37
ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
38
38
op : OpTy < ' tcx , Tag > ,
39
39
offset : u64 ,
40
- value : impl Into < ScalarMaybeUndef < Tag > > ,
40
+ value : impl Into < ScalarMaybeUninit < Tag > > ,
41
41
layout : TyAndLayout < ' tcx > ,
42
42
min_size : u64 ,
43
43
) -> InterpResult < ' tcx , ( ) > {
@@ -59,14 +59,14 @@ const PTHREAD_MUTEXATTR_T_MIN_SIZE: u64 = 4;
59
59
fn mutexattr_get_kind < ' mir , ' tcx : ' mir > (
60
60
ecx : & MiriEvalContext < ' mir , ' tcx > ,
61
61
attr_op : OpTy < ' tcx , Tag > ,
62
- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
62
+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
63
63
get_at_offset ( ecx, attr_op, 0 , ecx. machine . layouts . i32 , PTHREAD_MUTEXATTR_T_MIN_SIZE )
64
64
}
65
65
66
66
fn mutexattr_set_kind < ' mir , ' tcx : ' mir > (
67
67
ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
68
68
attr_op : OpTy < ' tcx , Tag > ,
69
- kind : impl Into < ScalarMaybeUndef < Tag > > ,
69
+ kind : impl Into < ScalarMaybeUninit < Tag > > ,
70
70
) -> InterpResult < ' tcx , ( ) > {
71
71
set_at_offset ( ecx, attr_op, 0 , kind, ecx. machine . layouts . i32 , PTHREAD_MUTEXATTR_T_MIN_SIZE )
72
72
}
@@ -88,45 +88,45 @@ const PTHREAD_MUTEX_T_MIN_SIZE: u64 = 24;
88
88
fn mutex_get_locked_count < ' mir , ' tcx : ' mir > (
89
89
ecx : & MiriEvalContext < ' mir , ' tcx > ,
90
90
mutex_op : OpTy < ' tcx , Tag > ,
91
- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
91
+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
92
92
get_at_offset ( ecx, mutex_op, 4 , ecx. machine . layouts . u32 , PTHREAD_MUTEX_T_MIN_SIZE )
93
93
}
94
94
95
95
fn mutex_set_locked_count < ' mir , ' tcx : ' mir > (
96
96
ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
97
97
mutex_op : OpTy < ' tcx , Tag > ,
98
- locked_count : impl Into < ScalarMaybeUndef < Tag > > ,
98
+ locked_count : impl Into < ScalarMaybeUninit < Tag > > ,
99
99
) -> InterpResult < ' tcx , ( ) > {
100
100
set_at_offset ( ecx, mutex_op, 4 , locked_count, ecx. machine . layouts . u32 , PTHREAD_MUTEX_T_MIN_SIZE )
101
101
}
102
102
103
103
fn mutex_get_owner < ' mir , ' tcx : ' mir > (
104
104
ecx : & MiriEvalContext < ' mir , ' tcx > ,
105
105
mutex_op : OpTy < ' tcx , Tag > ,
106
- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
106
+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
107
107
get_at_offset ( ecx, mutex_op, 8 , ecx. machine . layouts . u32 , PTHREAD_MUTEX_T_MIN_SIZE )
108
108
}
109
109
110
110
fn mutex_set_owner < ' mir , ' tcx : ' mir > (
111
111
ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
112
112
mutex_op : OpTy < ' tcx , Tag > ,
113
- owner : impl Into < ScalarMaybeUndef < Tag > > ,
113
+ owner : impl Into < ScalarMaybeUninit < Tag > > ,
114
114
) -> InterpResult < ' tcx , ( ) > {
115
115
set_at_offset ( ecx, mutex_op, 8 , owner, ecx. machine . layouts . u32 , PTHREAD_MUTEX_T_MIN_SIZE )
116
116
}
117
117
118
118
fn mutex_get_kind < ' mir , ' tcx : ' mir > (
119
119
ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
120
120
mutex_op : OpTy < ' tcx , Tag > ,
121
- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
121
+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
122
122
let offset = if ecx. pointer_size ( ) . bytes ( ) == 8 { 16 } else { 12 } ;
123
123
get_at_offset ( ecx, mutex_op, offset, ecx. machine . layouts . i32 , PTHREAD_MUTEX_T_MIN_SIZE )
124
124
}
125
125
126
126
fn mutex_set_kind < ' mir , ' tcx : ' mir > (
127
127
ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
128
128
mutex_op : OpTy < ' tcx , Tag > ,
129
- kind : impl Into < ScalarMaybeUndef < Tag > > ,
129
+ kind : impl Into < ScalarMaybeUninit < Tag > > ,
130
130
) -> InterpResult < ' tcx , ( ) > {
131
131
let offset = if ecx. pointer_size ( ) . bytes ( ) == 8 { 16 } else { 12 } ;
132
132
set_at_offset ( ecx, mutex_op, offset, kind, ecx. machine . layouts . i32 , PTHREAD_MUTEX_T_MIN_SIZE )
@@ -135,14 +135,14 @@ fn mutex_set_kind<'mir, 'tcx: 'mir>(
135
135
fn mutex_get_blockset < ' mir , ' tcx : ' mir > (
136
136
ecx : & MiriEvalContext < ' mir , ' tcx > ,
137
137
mutex_op : OpTy < ' tcx , Tag > ,
138
- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
138
+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
139
139
get_at_offset ( ecx, mutex_op, 20 , ecx. machine . layouts . u32 , PTHREAD_MUTEX_T_MIN_SIZE )
140
140
}
141
141
142
142
fn mutex_set_blockset < ' mir , ' tcx : ' mir > (
143
143
ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
144
144
mutex_op : OpTy < ' tcx , Tag > ,
145
- blockset : impl Into < ScalarMaybeUndef < Tag > > ,
145
+ blockset : impl Into < ScalarMaybeUninit < Tag > > ,
146
146
) -> InterpResult < ' tcx , ( ) > {
147
147
set_at_offset ( ecx, mutex_op, 20 , blockset, ecx. machine . layouts . u32 , PTHREAD_MUTEX_T_MIN_SIZE )
148
148
}
@@ -180,44 +180,44 @@ const PTHREAD_RWLOCK_T_MIN_SIZE: u64 = 20;
180
180
fn rwlock_get_readers < ' mir , ' tcx : ' mir > (
181
181
ecx : & MiriEvalContext < ' mir , ' tcx > ,
182
182
rwlock_op : OpTy < ' tcx , Tag > ,
183
- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
183
+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
184
184
get_at_offset ( ecx, rwlock_op, 4 , ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
185
185
}
186
186
187
187
fn rwlock_set_readers < ' mir , ' tcx : ' mir > (
188
188
ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
189
189
rwlock_op : OpTy < ' tcx , Tag > ,
190
- readers : impl Into < ScalarMaybeUndef < Tag > > ,
190
+ readers : impl Into < ScalarMaybeUninit < Tag > > ,
191
191
) -> InterpResult < ' tcx , ( ) > {
192
192
set_at_offset ( ecx, rwlock_op, 4 , readers, ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
193
193
}
194
194
195
195
fn rwlock_get_writers < ' mir , ' tcx : ' mir > (
196
196
ecx : & MiriEvalContext < ' mir , ' tcx > ,
197
197
rwlock_op : OpTy < ' tcx , Tag > ,
198
- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
198
+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
199
199
get_at_offset ( ecx, rwlock_op, 8 , ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
200
200
}
201
201
202
202
fn rwlock_set_writers < ' mir , ' tcx : ' mir > (
203
203
ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
204
204
rwlock_op : OpTy < ' tcx , Tag > ,
205
- writers : impl Into < ScalarMaybeUndef < Tag > > ,
205
+ writers : impl Into < ScalarMaybeUninit < Tag > > ,
206
206
) -> InterpResult < ' tcx , ( ) > {
207
207
set_at_offset ( ecx, rwlock_op, 8 , writers, ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
208
208
}
209
209
210
210
fn rwlock_get_writer_blockset < ' mir , ' tcx : ' mir > (
211
211
ecx : & MiriEvalContext < ' mir , ' tcx > ,
212
212
rwlock_op : OpTy < ' tcx , Tag > ,
213
- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
213
+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
214
214
get_at_offset ( ecx, rwlock_op, 12 , ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
215
215
}
216
216
217
217
fn rwlock_set_writer_blockset < ' mir , ' tcx : ' mir > (
218
218
ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
219
219
rwlock_op : OpTy < ' tcx , Tag > ,
220
- blockset : impl Into < ScalarMaybeUndef < Tag > > ,
220
+ blockset : impl Into < ScalarMaybeUninit < Tag > > ,
221
221
) -> InterpResult < ' tcx , ( ) > {
222
222
set_at_offset ( ecx, rwlock_op, 12 , blockset, ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
223
223
}
@@ -241,14 +241,14 @@ fn rwlock_get_or_create_writer_blockset<'mir, 'tcx: 'mir>(
241
241
fn rwlock_get_reader_blockset < ' mir , ' tcx : ' mir > (
242
242
ecx : & MiriEvalContext < ' mir , ' tcx > ,
243
243
rwlock_op : OpTy < ' tcx , Tag > ,
244
- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
244
+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
245
245
get_at_offset ( ecx, rwlock_op, 16 , ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
246
246
}
247
247
248
248
fn rwlock_set_reader_blockset < ' mir , ' tcx : ' mir > (
249
249
ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
250
250
rwlock_op : OpTy < ' tcx , Tag > ,
251
- blockset : impl Into < ScalarMaybeUndef < Tag > > ,
251
+ blockset : impl Into < ScalarMaybeUninit < Tag > > ,
252
252
) -> InterpResult < ' tcx , ( ) > {
253
253
set_at_offset ( ecx, rwlock_op, 16 , blockset, ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
254
254
}
@@ -304,7 +304,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
304
304
fn pthread_mutexattr_destroy ( & mut self , attr_op : OpTy < ' tcx , Tag > ) -> InterpResult < ' tcx , i32 > {
305
305
let this = self . eval_context_mut ( ) ;
306
306
307
- mutexattr_set_kind ( this, attr_op, ScalarMaybeUndef :: Undef ) ?;
307
+ mutexattr_set_kind ( this, attr_op, ScalarMaybeUninit :: Uninit ) ?;
308
308
309
309
Ok ( 0 )
310
310
}
@@ -458,9 +458,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
458
458
throw_ub_format ! ( "destroyed a locked mutex" ) ;
459
459
}
460
460
461
- mutex_set_kind ( this, mutex_op, ScalarMaybeUndef :: Undef ) ?;
462
- mutex_set_locked_count ( this, mutex_op, ScalarMaybeUndef :: Undef ) ?;
463
- mutex_set_blockset ( this, mutex_op, ScalarMaybeUndef :: Undef ) ?;
461
+ mutex_set_kind ( this, mutex_op, ScalarMaybeUninit :: Uninit ) ?;
462
+ mutex_set_locked_count ( this, mutex_op, ScalarMaybeUninit :: Uninit ) ?;
463
+ mutex_set_blockset ( this, mutex_op, ScalarMaybeUninit :: Uninit ) ?;
464
464
465
465
Ok ( 0 )
466
466
}
@@ -579,10 +579,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
579
579
throw_ub_format ! ( "destroyed a locked rwlock" ) ;
580
580
}
581
581
582
- rwlock_set_readers ( this, rwlock_op, ScalarMaybeUndef :: Undef ) ?;
583
- rwlock_set_writers ( this, rwlock_op, ScalarMaybeUndef :: Undef ) ?;
584
- rwlock_set_reader_blockset ( this, rwlock_op, ScalarMaybeUndef :: Undef ) ?;
585
- rwlock_set_writer_blockset ( this, rwlock_op, ScalarMaybeUndef :: Undef ) ?;
582
+ rwlock_set_readers ( this, rwlock_op, ScalarMaybeUninit :: Uninit ) ?;
583
+ rwlock_set_writers ( this, rwlock_op, ScalarMaybeUninit :: Uninit ) ?;
584
+ rwlock_set_reader_blockset ( this, rwlock_op, ScalarMaybeUninit :: Uninit ) ?;
585
+ rwlock_set_writer_blockset ( this, rwlock_op, ScalarMaybeUninit :: Uninit ) ?;
586
586
587
587
Ok ( 0 )
588
588
}
0 commit comments