Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miri subtree update #125580

Merged
merged 36 commits into from
May 27, 2024
Merged
Changes from 2 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
37a37f6
Use `throw_unsup_format` instead of returning `ENOTSUP` in the mmap shim
marc0246 May 20, 2024
41c006e
Auto merge of #3610 - marc0246:missing-error-kinds, r=RalfJung
bors May 20, 2024
24138f0
Preparing for merge from rustc
RalfJung May 22, 2024
a1bc030
Merge from rustc
RalfJung May 22, 2024
abbe244
clippy
RalfJung May 22, 2024
7fd1429
Auto merge of #3623 - RalfJung:rustup, r=RalfJung
bors May 22, 2024
3f638a9
solaris/illumos localtime_r / clock_getime support enabled.
devnexen May 18, 2024
04a9a1a
Auto merge of #3614 - devnexen:illumos_time_support, r=oli-obk
bors May 22, 2024
807a0f8
Preparing for merge from rustc
May 23, 2024
f1ffb8d
Merge from rustc
May 23, 2024
400835f
fmt
May 23, 2024
6ea763b
Auto merge of #3624 - rust-lang:rustup-2024-05-23, r=RalfJung
bors May 23, 2024
56c363b
fix alloc_bytes (always allocate at least 1B)
Strophox May 23, 2024
1b374df
differentiate between layout and alloc_layout
Strophox May 23, 2024
7f5e0aa
solaris add suport for threadname.
devnexen May 23, 2024
9ce95c3
Preparing for merge from rustc
May 24, 2024
debf88a
Merge from rustc
May 24, 2024
4763eaf
fmt
May 24, 2024
10d4140
Auto merge of #3627 - rust-lang:rustup-2024-05-24, r=RalfJung
bors May 24, 2024
561bd9a
add back some tokio features
RalfJung May 24, 2024
88d519f
Auto merge of #3628 - RalfJung:tokio, r=RalfJung
bors May 24, 2024
b84620f
extend comments
RalfJung May 24, 2024
7fc41d1
Auto merge of #3625 - Strophox:miri-allocation-fix, r=RalfJung
bors May 24, 2024
008f6b3
Auto merge of #3626 - devnexen:pthread_name_illumos, r=oli-obk
bors May 24, 2024
3cfcfbf
Preparing for merge from rustc
May 25, 2024
1d0ad04
Merge from rustc
May 25, 2024
331bb3f
Auto merge of #3630 - rust-lang:rustup-2024-05-25, r=saethlin
bors May 25, 2024
5fa30f7
make release_clock always work on the current thread
RalfJung May 26, 2024
a131243
completely refactor how we manage blocking and unblocking threads
RalfJung May 26, 2024
e6bb468
data_race: vector indices can be reused immediately when the thread i…
RalfJung May 26, 2024
cbec128
fix './miri run --dep --target _'
RalfJung May 26, 2024
e09bf56
Auto merge of #3633 - RalfJung:target, r=RalfJung
bors May 26, 2024
350f5c8
unix/fs: a bit of cleanup in macos_fbsd_readdir_r
RalfJung May 26, 2024
8e861c6
Auto merge of #3632 - RalfJung:readdir, r=RalfJung
bors May 26, 2024
2e89443
add a macro to declare thread unblock callbacks
RalfJung May 26, 2024
0963353
Auto merge of #3631 - RalfJung:blocking-refactor, r=RalfJung
bors May 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 33 additions & 35 deletions src/tools/miri/src/shims/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
// The name is written with write_os_str_to_c_str, while the rest of the
// dirent struct is written using write_int_fields.

// For reference:
// For reference, on macOS this looks like:
// pub struct dirent {
// pub d_ino: u64,
// pub d_seekoff: u64,
Expand Down Expand Up @@ -1025,40 +1025,38 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {

let file_type = this.file_type_to_d_type(dir_entry.file_type())?;

// macOS offset field is d_seekoff
if this.projectable_has_field(&entry_place, "d_seekoff") {
this.write_int_fields_named(
&[
("d_ino", ino.into()),
("d_seekoff", 0),
("d_reclen", 0),
("d_namlen", file_name_len.into()),
("d_type", file_type.into()),
],
&entry_place,
)?;
} else if this.projectable_has_field(&entry_place, "d_off") {
// freebsd 12 and onwards had added the d_off field
this.write_int_fields_named(
&[
("d_fileno", ino.into()),
("d_off", 0),
("d_reclen", 0),
("d_type", file_type.into()),
("d_namlen", file_name_len.into()),
],
&entry_place,
)?;
} else {
this.write_int_fields_named(
&[
("d_fileno", ino.into()),
("d_reclen", 0),
("d_type", file_type.into()),
("d_namlen", file_name_len.into()),
],
&entry_place,
)?;
// Common fields.
this.write_int_fields_named(
&[
("d_reclen", 0),
("d_namlen", file_name_len.into()),
("d_type", file_type.into()),
],
&entry_place,
)?;
// Special fields.
match &*this.tcx.sess.target.os {
"macos" => {
#[rustfmt::skip]
this.write_int_fields_named(
&[
("d_ino", ino.into()),
("d_seekoff", 0),
],
&entry_place,
)?;
}
"freebsd" => {
this.write_int(ino, &this.project_field_named(&entry_place, "d_fileno")?)?;
// `d_off` only exists on FreeBSD 12+, but we support v11 as well.
// `libc` uses a build script to determine which version of the API to use,
// and cross-builds always end up using v11.
// To support both v11 and v12+, we dynamically check whether the field exists.
if this.projectable_has_field(&entry_place, "d_off") {
this.write_int(0, &this.project_field_named(&entry_place, "d_off")?)?;
}
}
_ => unreachable!(),
}

let result_place = this.deref_pointer(result_op)?;
Expand Down