@@ -25,7 +25,7 @@ fn get_at_offset<'mir, 'tcx: 'mir>(
2525 offset : u64 ,
2626 layout : TyAndLayout < ' tcx > ,
2727 min_size : u64 ,
28- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
28+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
2929 // Ensure that the following read at an offset to the attr pointer is within bounds
3030 assert_ptr_target_min_size ( ecx, op, min_size) ?;
3131 let op_place = ecx. deref_operand ( op) ?;
@@ -37,7 +37,7 @@ fn set_at_offset<'mir, 'tcx: 'mir>(
3737 ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
3838 op : OpTy < ' tcx , Tag > ,
3939 offset : u64 ,
40- value : impl Into < ScalarMaybeUndef < Tag > > ,
40+ value : impl Into < ScalarMaybeUninit < Tag > > ,
4141 layout : TyAndLayout < ' tcx > ,
4242 min_size : u64 ,
4343) -> InterpResult < ' tcx , ( ) > {
@@ -59,14 +59,14 @@ const PTHREAD_MUTEXATTR_T_MIN_SIZE: u64 = 4;
5959fn mutexattr_get_kind < ' mir , ' tcx : ' mir > (
6060 ecx : & MiriEvalContext < ' mir , ' tcx > ,
6161 attr_op : OpTy < ' tcx , Tag > ,
62- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
62+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
6363 get_at_offset ( ecx, attr_op, 0 , ecx. machine . layouts . i32 , PTHREAD_MUTEXATTR_T_MIN_SIZE )
6464}
6565
6666fn mutexattr_set_kind < ' mir , ' tcx : ' mir > (
6767 ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
6868 attr_op : OpTy < ' tcx , Tag > ,
69- kind : impl Into < ScalarMaybeUndef < Tag > > ,
69+ kind : impl Into < ScalarMaybeUninit < Tag > > ,
7070) -> InterpResult < ' tcx , ( ) > {
7171 set_at_offset ( ecx, attr_op, 0 , kind, ecx. machine . layouts . i32 , PTHREAD_MUTEXATTR_T_MIN_SIZE )
7272}
@@ -88,45 +88,45 @@ const PTHREAD_MUTEX_T_MIN_SIZE: u64 = 24;
8888fn mutex_get_locked_count < ' mir , ' tcx : ' mir > (
8989 ecx : & MiriEvalContext < ' mir , ' tcx > ,
9090 mutex_op : OpTy < ' tcx , Tag > ,
91- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
91+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
9292 get_at_offset ( ecx, mutex_op, 4 , ecx. machine . layouts . u32 , PTHREAD_MUTEX_T_MIN_SIZE )
9393}
9494
9595fn mutex_set_locked_count < ' mir , ' tcx : ' mir > (
9696 ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
9797 mutex_op : OpTy < ' tcx , Tag > ,
98- locked_count : impl Into < ScalarMaybeUndef < Tag > > ,
98+ locked_count : impl Into < ScalarMaybeUninit < Tag > > ,
9999) -> InterpResult < ' tcx , ( ) > {
100100 set_at_offset ( ecx, mutex_op, 4 , locked_count, ecx. machine . layouts . u32 , PTHREAD_MUTEX_T_MIN_SIZE )
101101}
102102
103103fn mutex_get_owner < ' mir , ' tcx : ' mir > (
104104 ecx : & MiriEvalContext < ' mir , ' tcx > ,
105105 mutex_op : OpTy < ' tcx , Tag > ,
106- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
106+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
107107 get_at_offset ( ecx, mutex_op, 8 , ecx. machine . layouts . u32 , PTHREAD_MUTEX_T_MIN_SIZE )
108108}
109109
110110fn mutex_set_owner < ' mir , ' tcx : ' mir > (
111111 ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
112112 mutex_op : OpTy < ' tcx , Tag > ,
113- owner : impl Into < ScalarMaybeUndef < Tag > > ,
113+ owner : impl Into < ScalarMaybeUninit < Tag > > ,
114114) -> InterpResult < ' tcx , ( ) > {
115115 set_at_offset ( ecx, mutex_op, 8 , owner, ecx. machine . layouts . u32 , PTHREAD_MUTEX_T_MIN_SIZE )
116116}
117117
118118fn mutex_get_kind < ' mir , ' tcx : ' mir > (
119119 ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
120120 mutex_op : OpTy < ' tcx , Tag > ,
121- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
121+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
122122 let offset = if ecx. pointer_size ( ) . bytes ( ) == 8 { 16 } else { 12 } ;
123123 get_at_offset ( ecx, mutex_op, offset, ecx. machine . layouts . i32 , PTHREAD_MUTEX_T_MIN_SIZE )
124124}
125125
126126fn mutex_set_kind < ' mir , ' tcx : ' mir > (
127127 ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
128128 mutex_op : OpTy < ' tcx , Tag > ,
129- kind : impl Into < ScalarMaybeUndef < Tag > > ,
129+ kind : impl Into < ScalarMaybeUninit < Tag > > ,
130130) -> InterpResult < ' tcx , ( ) > {
131131 let offset = if ecx. pointer_size ( ) . bytes ( ) == 8 { 16 } else { 12 } ;
132132 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>(
135135fn mutex_get_blockset < ' mir , ' tcx : ' mir > (
136136 ecx : & MiriEvalContext < ' mir , ' tcx > ,
137137 mutex_op : OpTy < ' tcx , Tag > ,
138- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
138+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
139139 get_at_offset ( ecx, mutex_op, 20 , ecx. machine . layouts . u32 , PTHREAD_MUTEX_T_MIN_SIZE )
140140}
141141
142142fn mutex_set_blockset < ' mir , ' tcx : ' mir > (
143143 ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
144144 mutex_op : OpTy < ' tcx , Tag > ,
145- blockset : impl Into < ScalarMaybeUndef < Tag > > ,
145+ blockset : impl Into < ScalarMaybeUninit < Tag > > ,
146146) -> InterpResult < ' tcx , ( ) > {
147147 set_at_offset ( ecx, mutex_op, 20 , blockset, ecx. machine . layouts . u32 , PTHREAD_MUTEX_T_MIN_SIZE )
148148}
@@ -180,44 +180,44 @@ const PTHREAD_RWLOCK_T_MIN_SIZE: u64 = 20;
180180fn rwlock_get_readers < ' mir , ' tcx : ' mir > (
181181 ecx : & MiriEvalContext < ' mir , ' tcx > ,
182182 rwlock_op : OpTy < ' tcx , Tag > ,
183- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
183+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
184184 get_at_offset ( ecx, rwlock_op, 4 , ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
185185}
186186
187187fn rwlock_set_readers < ' mir , ' tcx : ' mir > (
188188 ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
189189 rwlock_op : OpTy < ' tcx , Tag > ,
190- readers : impl Into < ScalarMaybeUndef < Tag > > ,
190+ readers : impl Into < ScalarMaybeUninit < Tag > > ,
191191) -> InterpResult < ' tcx , ( ) > {
192192 set_at_offset ( ecx, rwlock_op, 4 , readers, ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
193193}
194194
195195fn rwlock_get_writers < ' mir , ' tcx : ' mir > (
196196 ecx : & MiriEvalContext < ' mir , ' tcx > ,
197197 rwlock_op : OpTy < ' tcx , Tag > ,
198- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
198+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
199199 get_at_offset ( ecx, rwlock_op, 8 , ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
200200}
201201
202202fn rwlock_set_writers < ' mir , ' tcx : ' mir > (
203203 ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
204204 rwlock_op : OpTy < ' tcx , Tag > ,
205- writers : impl Into < ScalarMaybeUndef < Tag > > ,
205+ writers : impl Into < ScalarMaybeUninit < Tag > > ,
206206) -> InterpResult < ' tcx , ( ) > {
207207 set_at_offset ( ecx, rwlock_op, 8 , writers, ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
208208}
209209
210210fn rwlock_get_writer_blockset < ' mir , ' tcx : ' mir > (
211211 ecx : & MiriEvalContext < ' mir , ' tcx > ,
212212 rwlock_op : OpTy < ' tcx , Tag > ,
213- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
213+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
214214 get_at_offset ( ecx, rwlock_op, 12 , ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
215215}
216216
217217fn rwlock_set_writer_blockset < ' mir , ' tcx : ' mir > (
218218 ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
219219 rwlock_op : OpTy < ' tcx , Tag > ,
220- blockset : impl Into < ScalarMaybeUndef < Tag > > ,
220+ blockset : impl Into < ScalarMaybeUninit < Tag > > ,
221221) -> InterpResult < ' tcx , ( ) > {
222222 set_at_offset ( ecx, rwlock_op, 12 , blockset, ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
223223}
@@ -241,14 +241,14 @@ fn rwlock_get_or_create_writer_blockset<'mir, 'tcx: 'mir>(
241241fn rwlock_get_reader_blockset < ' mir , ' tcx : ' mir > (
242242 ecx : & MiriEvalContext < ' mir , ' tcx > ,
243243 rwlock_op : OpTy < ' tcx , Tag > ,
244- ) -> InterpResult < ' tcx , ScalarMaybeUndef < Tag > > {
244+ ) -> InterpResult < ' tcx , ScalarMaybeUninit < Tag > > {
245245 get_at_offset ( ecx, rwlock_op, 16 , ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
246246}
247247
248248fn rwlock_set_reader_blockset < ' mir , ' tcx : ' mir > (
249249 ecx : & mut MiriEvalContext < ' mir , ' tcx > ,
250250 rwlock_op : OpTy < ' tcx , Tag > ,
251- blockset : impl Into < ScalarMaybeUndef < Tag > > ,
251+ blockset : impl Into < ScalarMaybeUninit < Tag > > ,
252252) -> InterpResult < ' tcx , ( ) > {
253253 set_at_offset ( ecx, rwlock_op, 16 , blockset, ecx. machine . layouts . u32 , PTHREAD_RWLOCK_T_MIN_SIZE )
254254}
@@ -304,7 +304,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
304304 fn pthread_mutexattr_destroy ( & mut self , attr_op : OpTy < ' tcx , Tag > ) -> InterpResult < ' tcx , i32 > {
305305 let this = self . eval_context_mut ( ) ;
306306
307- mutexattr_set_kind ( this, attr_op, ScalarMaybeUndef :: Undef ) ?;
307+ mutexattr_set_kind ( this, attr_op, ScalarMaybeUninit :: Uninit ) ?;
308308
309309 Ok ( 0 )
310310 }
@@ -458,9 +458,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
458458 throw_ub_format ! ( "destroyed a locked mutex" ) ;
459459 }
460460
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 ) ?;
464464
465465 Ok ( 0 )
466466 }
@@ -579,10 +579,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
579579 throw_ub_format ! ( "destroyed a locked rwlock" ) ;
580580 }
581581
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 ) ?;
586586
587587 Ok ( 0 )
588588 }
0 commit comments