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

fix checking os_family #1786

Merged
merged 2 commits into from
May 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion rust-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
bcd696d722c04a0f8c34d884aa4ed2322f55cdd8
59f551a2dcf57c0d3d96ac5ef60e000524210469
4 changes: 2 additions & 2 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
let this = self.eval_context_mut();
let target = &this.tcx.sess.target;
let target_os = &target.os;
let last_error = if target.os_family == Some("unix".to_owned()) {
let last_error = if target.families.contains(&"unix".to_owned()) {
this.eval_libc(match e.kind() {
ConnectionRefused => "ECONNREFUSED",
ConnectionReset => "ECONNRESET",
Expand All @@ -463,7 +463,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
throw_unsup_format!("io error {} cannot be transformed into a raw os error", e)
}
})?
} else if target_os == "windows" {
} else if target.families.contains(&"windows".to_owned()) {
// FIXME: we have to finish implementing the Windows equivalent of this.
this.eval_windows("c", match e.kind() {
NotFound => "ERROR_FILE_NOT_FOUND",
Expand Down
12 changes: 6 additions & 6 deletions src/shims/foreign_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,16 +512,16 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
let &[] = check_arg_count(args)?;
this.yield_active_thread();
}
"llvm.aarch64.hint" if this.tcx.sess.target.arch == "aarch64" => {
"llvm.aarch64.isb" if this.tcx.sess.target.arch == "aarch64" => {
check_abi(abi, Abi::C { unwind: false })?;
let &[ref hint] = check_arg_count(args)?;
let hint = this.read_scalar(hint)?.to_i32()?;
match hint {
1 => { // HINT_YIELD
let &[ref arg] = check_arg_count(args)?;
let arg = this.read_scalar(arg)?.to_i32()?;
match arg {
15 => { // SY ("full system scope")
this.yield_active_thread();
}
_ => {
throw_unsup_format!("unsupported llvm.aarch64.hint argument {}", hint);
throw_unsup_format!("unsupported llvm.aarch64.isb argument {}", arg);
}
}
}
Expand Down