@@ -302,12 +302,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
302
302
let blksize_t_layout = this. libc_ty_layout ( "blksize_t" ) ?;
303
303
let uint32_t_layout = this. libc_ty_layout ( "uint32_t" ) ?;
304
304
305
- // We need to add 32 bits of padding after `st_rdev` if we are in a 64-bit platform. To do
306
- // this, we store `st_rdev` as a `c_long` instead of a `dev_t`.
307
- let st_rdev_layout = if this. tcx . sess . target . ptr_width == 64 {
308
- long_layout
305
+ // We need to add 32 bits of padding after `st_rdev` if we are in a 64-bit platform.
306
+ let pad_layout = if this. tcx . sess . target . ptr_width == 64 {
307
+ uint32_t_layout
309
308
} else {
310
- dev_t_layout
309
+ this . layout_of ( this . tcx . mk_unit ( ) ) ?
311
310
} ;
312
311
313
312
let imms = [
@@ -317,7 +316,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
317
316
immty_from_uint_checked ( 0u128 , ino_t_layout) ?, // st_ino
318
317
immty_from_uint_checked ( 0u128 , uid_t_layout) ?, // st_uid
319
318
immty_from_uint_checked ( 0u128 , gid_t_layout) ?, // st_gid
320
- immty_from_uint_checked ( 0u128 , st_rdev_layout) ?, // st_rdev
319
+ immty_from_uint_checked ( 0u128 , dev_t_layout) ?, // st_rdev
320
+ immty_from_uint_checked ( 0u128 , pad_layout) ?, // padding for 64-bit targets
321
321
immty_from_uint_checked ( access_sec, time_t_layout) ?, // st_atime
322
322
immty_from_uint_checked ( access_nsec, long_layout) ?, // st_atime_nsec
323
323
immty_from_uint_checked ( modified_sec, time_t_layout) ?, // st_mtime
0 commit comments