@@ -1270,12 +1270,6 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
1270
1270
let entry =
1271
1271
this. malloc ( size, /*zero_init:*/ false , MiriMemoryKind :: Runtime ) ?;
1272
1272
1273
- // FIXME: make use of dirent64_layout
1274
- let ino64_t_layout = this. libc_ty_layout ( "ino64_t" ) ?;
1275
- let off64_t_layout = this. libc_ty_layout ( "off64_t" ) ?;
1276
- let c_ushort_layout = this. libc_ty_layout ( "c_ushort" ) ?;
1277
- let c_uchar_layout = this. libc_ty_layout ( "c_uchar" ) ?;
1278
-
1279
1273
// If the host is a Unix system, fill in the inode number with its real value.
1280
1274
// If not, use 0 as a fallback value.
1281
1275
#[ cfg( unix) ]
@@ -1285,15 +1279,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
1285
1279
1286
1280
let file_type = this. file_type_to_d_type ( dir_entry. file_type ( ) ) ?;
1287
1281
1288
- let imms = [
1289
- immty_from_uint_checked ( ino, ino64_t_layout) ?, // d_ino
1290
- immty_from_uint_checked ( 0u128 , off64_t_layout) ?, // d_off
1291
- immty_from_uint_checked ( size, c_ushort_layout) ?, // d_reclen
1292
- immty_from_int_checked ( file_type, c_uchar_layout) ?, // d_type
1293
- ] ;
1294
- let entry_layout = this. layout_of ( this. tcx . mk_array ( this. tcx . types . u8 , size) ) ?;
1295
- let entry_place = MPlaceTy :: from_aligned_ptr ( entry, entry_layout) ;
1296
- this. write_packed_immediates ( & entry_place, & imms) ?;
1282
+ let entry_place = MPlaceTy :: from_aligned_ptr ( entry, dirent64_layout) ;
1283
+ this. write_uint ( ino, & this. mplace_field ( & entry_place, 0 ) ?. into ( ) ) ?; // d_ino
1284
+ this. write_uint ( 0u128 , & this. mplace_field ( & entry_place, 1 ) ?. into ( ) ) ?; // d_off
1285
+ this. write_uint ( size, & this. mplace_field ( & entry_place, 2 ) ?. into ( ) ) ?; // d_reclen
1286
+ this. write_int ( file_type, & this. mplace_field ( & entry_place, 3 ) ?. into ( ) ) ?; // d_type
1297
1287
1298
1288
let name_ptr = entry. offset ( Size :: from_bytes ( d_name_offset) , this) ?;
1299
1289
this. memory . write_bytes ( name_ptr, name_bytes. iter ( ) . copied ( ) ) ?;
0 commit comments