Fix interpreted OS detection
This commit is contained in:
parent
9a6921a17f
commit
d4b73efa81
1 changed files with 5 additions and 4 deletions
|
|
@ -785,10 +785,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
|
|||
|
||||
this.check_no_isolation("mkdir")?;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
let mode = this.read_scalar(mode_op)?.to_u32()?;
|
||||
#[cfg(not(target_os = "linux"))]
|
||||
let mode = this.read_scalar(mode_op)?.not_undef()?.to_u16()?;
|
||||
let mode = if this.tcx.sess.target.target.target_os.to_lowercase() == "macos" {
|
||||
this.read_scalar(mode_op)?.not_undef()?.to_u16()? as u32
|
||||
} else {
|
||||
this.read_scalar(mode_op)?.to_u32()?
|
||||
};
|
||||
|
||||
let path = this.read_os_str_from_c_str(this.read_scalar(path_op)?.not_undef()?)?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue