Skip to content

Commit

Permalink
Removed unrelated now changes
Browse files Browse the repository at this point in the history
  • Loading branch information
YohDeadfall committed Oct 7, 2024
1 parent 48c5509 commit 8b4e661
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
20 changes: 0 additions & 20 deletions src/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,26 +675,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
)
}

/// Helper function used inside the shims of foreign functions to assert that the target OS
/// is one of `target_oses`. It panics showing a message with the `name` of the foreign function
/// if this is not the case.
fn assert_target_os_is_one_of(&self, target_oses: &[&str], name: &str) {
assert!(
target_oses.contains(&self.eval_context_ref().tcx.sess.target.os.as_ref()),
"`{name}` is only available on the {} target OS's",
target_oses
.iter()
.enumerate()
.map(|(i, t)| {
match i {
0 => format!("`{t}`"),
_ => format!(", `{t}`"),
}
})
.collect::<String>()
)
}

/// Helper function used inside the shims of foreign functions to assert that the target OS
/// is part of the UNIX family. It panics showing a message with the `name` of the foreign function
/// if this is not the case.
Expand Down
2 changes: 1 addition & 1 deletion src/shims/unix/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {

fn linux_gettid(&mut self) -> InterpResult<'tcx, Scalar> {
let this = self.eval_context_ref();
this.assert_target_os_is_one_of(&["linux", "android"], "gettid");
this.assert_target_os("linux", "gettid");

let index = this.machine.threads.active_thread().to_u32();

Expand Down

0 comments on commit 8b4e661

Please sign in to comment.