@@ -31,7 +31,8 @@ fn mutexattr_get_kind<'mir, 'tcx: 'mir>(
3131 // Ensure that the following read at an offset to the attr pointer is within bounds
3232 assert_ptr_target_min_size ( ecx, attr_op, 4 ) ?;
3333 let attr_place = ecx. deref_operand ( attr_op) ?;
34- let kind_place = attr_place. offset ( Size :: ZERO , MemPlaceMeta :: None , ecx. i32_layout ( ) ?, ecx) ?;
34+ let kind_place =
35+ attr_place. offset ( Size :: ZERO , MemPlaceMeta :: None , ecx. machine . layouts . i32 , ecx) ?;
3536 ecx. read_scalar ( kind_place. into ( ) )
3637}
3738
@@ -43,7 +44,8 @@ fn mutexattr_set_kind<'mir, 'tcx: 'mir>(
4344 // Ensure that the following write at an offset to the attr pointer is within bounds
4445 assert_ptr_target_min_size ( ecx, attr_op, 4 ) ?;
4546 let attr_place = ecx. deref_operand ( attr_op) ?;
46- let kind_place = attr_place. offset ( Size :: ZERO , MemPlaceMeta :: None , ecx. i32_layout ( ) ?, ecx) ?;
47+ let kind_place =
48+ attr_place. offset ( Size :: ZERO , MemPlaceMeta :: None , ecx. machine . layouts . i32 , ecx) ?;
4749 ecx. write_scalar ( kind. into ( ) , kind_place. into ( ) )
4850}
4951
@@ -63,8 +65,12 @@ fn mutex_get_locked_count<'mir, 'tcx: 'mir>(
6365 // Ensure that the following read at an offset to the mutex pointer is within bounds
6466 assert_ptr_target_min_size ( ecx, mutex_op, 20 ) ?;
6567 let mutex_place = ecx. deref_operand ( mutex_op) ?;
66- let locked_count_place =
67- mutex_place. offset ( Size :: from_bytes ( 4 ) , MemPlaceMeta :: None , ecx. u32_layout ( ) ?, ecx) ?;
68+ let locked_count_place = mutex_place. offset (
69+ Size :: from_bytes ( 4 ) ,
70+ MemPlaceMeta :: None ,
71+ ecx. machine . layouts . u32 ,
72+ ecx,
73+ ) ?;
6874 ecx. read_scalar ( locked_count_place. into ( ) )
6975}
7076
@@ -76,8 +82,12 @@ fn mutex_set_locked_count<'mir, 'tcx: 'mir>(
7682 // Ensure that the following write at an offset to the mutex pointer is within bounds
7783 assert_ptr_target_min_size ( ecx, mutex_op, 20 ) ?;
7884 let mutex_place = ecx. deref_operand ( mutex_op) ?;
79- let locked_count_place =
80- mutex_place. offset ( Size :: from_bytes ( 4 ) , MemPlaceMeta :: None , ecx. u32_layout ( ) ?, ecx) ?;
85+ let locked_count_place = mutex_place. offset (
86+ Size :: from_bytes ( 4 ) ,
87+ MemPlaceMeta :: None ,
88+ ecx. machine . layouts . u32 ,
89+ ecx,
90+ ) ?;
8191 ecx. write_scalar ( locked_count. into ( ) , locked_count_place. into ( ) )
8292}
8393
@@ -92,7 +102,7 @@ fn mutex_get_kind<'mir, 'tcx: 'mir>(
92102 let kind_place = mutex_place. offset (
93103 Size :: from_bytes ( kind_offset) ,
94104 MemPlaceMeta :: None ,
95- ecx. i32_layout ( ) ? ,
105+ ecx. machine . layouts . i32 ,
96106 ecx,
97107 ) ?;
98108 ecx. read_scalar ( kind_place. into ( ) )
@@ -110,7 +120,7 @@ fn mutex_set_kind<'mir, 'tcx: 'mir>(
110120 let kind_place = mutex_place. offset (
111121 Size :: from_bytes ( kind_offset) ,
112122 MemPlaceMeta :: None ,
113- ecx. i32_layout ( ) ? ,
123+ ecx. machine . layouts . i32 ,
114124 ecx,
115125 ) ?;
116126 ecx. write_scalar ( kind. into ( ) , kind_place. into ( ) )
@@ -131,8 +141,12 @@ fn rwlock_get_readers<'mir, 'tcx: 'mir>(
131141 // Ensure that the following read at an offset to the rwlock pointer is within bounds
132142 assert_ptr_target_min_size ( ecx, rwlock_op, 12 ) ?;
133143 let rwlock_place = ecx. deref_operand ( rwlock_op) ?;
134- let readers_place =
135- rwlock_place. offset ( Size :: from_bytes ( 4 ) , MemPlaceMeta :: None , ecx. u32_layout ( ) ?, ecx) ?;
144+ let readers_place = rwlock_place. offset (
145+ Size :: from_bytes ( 4 ) ,
146+ MemPlaceMeta :: None ,
147+ ecx. machine . layouts . u32 ,
148+ ecx,
149+ ) ?;
136150 ecx. read_scalar ( readers_place. into ( ) )
137151}
138152
@@ -144,8 +158,12 @@ fn rwlock_set_readers<'mir, 'tcx: 'mir>(
144158 // Ensure that the following write at an offset to the rwlock pointer is within bounds
145159 assert_ptr_target_min_size ( ecx, rwlock_op, 12 ) ?;
146160 let rwlock_place = ecx. deref_operand ( rwlock_op) ?;
147- let readers_place =
148- rwlock_place. offset ( Size :: from_bytes ( 4 ) , MemPlaceMeta :: None , ecx. u32_layout ( ) ?, ecx) ?;
161+ let readers_place = rwlock_place. offset (
162+ Size :: from_bytes ( 4 ) ,
163+ MemPlaceMeta :: None ,
164+ ecx. machine . layouts . u32 ,
165+ ecx,
166+ ) ?;
149167 ecx. write_scalar ( readers. into ( ) , readers_place. into ( ) )
150168}
151169
@@ -156,8 +174,12 @@ fn rwlock_get_writers<'mir, 'tcx: 'mir>(
156174 // Ensure that the following read at an offset to the rwlock pointer is within bounds
157175 assert_ptr_target_min_size ( ecx, rwlock_op, 12 ) ?;
158176 let rwlock_place = ecx. deref_operand ( rwlock_op) ?;
159- let writers_place =
160- rwlock_place. offset ( Size :: from_bytes ( 8 ) , MemPlaceMeta :: None , ecx. u32_layout ( ) ?, ecx) ?;
177+ let writers_place = rwlock_place. offset (
178+ Size :: from_bytes ( 8 ) ,
179+ MemPlaceMeta :: None ,
180+ ecx. machine . layouts . u32 ,
181+ ecx,
182+ ) ?;
161183 ecx. read_scalar ( writers_place. into ( ) )
162184}
163185
@@ -169,8 +191,12 @@ fn rwlock_set_writers<'mir, 'tcx: 'mir>(
169191 // Ensure that the following write at an offset to the rwlock pointer is within bounds
170192 assert_ptr_target_min_size ( ecx, rwlock_op, 12 ) ?;
171193 let rwlock_place = ecx. deref_operand ( rwlock_op) ?;
172- let writers_place =
173- rwlock_place. offset ( Size :: from_bytes ( 8 ) , MemPlaceMeta :: None , ecx. u32_layout ( ) ?, ecx) ?;
194+ let writers_place = rwlock_place. offset (
195+ Size :: from_bytes ( 8 ) ,
196+ MemPlaceMeta :: None ,
197+ ecx. machine . layouts . u32 ,
198+ ecx,
199+ ) ?;
174200 ecx. write_scalar ( writers. into ( ) , writers_place. into ( ) )
175201}
176202
0 commit comments