Skip to content

Commit d0ed718

Browse files
committed
Update to latest upstream
1 parent 3bd2ba0 commit d0ed718

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/shims/fs.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
100100
throw_unsup_format!("unsupported flags {:#x}", flag & !mirror);
101101
}
102102

103-
let path = this.read_os_str_from_c_str(this.read_scalar(path_op)?.not_undef()?)?;
103+
let path: PathBuf = this
104+
.read_os_str_from_c_str(this.read_scalar(path_op)?.not_undef()?)?
105+
.into();
104106

105107
let fd = options.open(&path).map(|file| {
106108
let mut fh = &mut this.machine.file_handler;
107109
fh.low += 1;
108-
fh.handles.insert(fh.low, FileHandle { file, path: path.into() }).unwrap_none();
110+
fh.handles.insert(fh.low, FileHandle { file, path }).unwrap_none();
109111
fh.low
110112
});
111113

@@ -297,7 +299,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
297299
let statxbuf_imm = ImmTy::from_scalar(Scalar::Ptr(statxbuf_ptr), statxbuf_layout);
298300
let statxbuf_place = this.ref_to_mplace(statxbuf_imm)?;
299301

300-
let pathname: PathBuf = this.read_os_string_from_c_string(pathname_scalar)?.into();
302+
let pathname: PathBuf = this.read_os_str_from_c_str(pathname_scalar)?.into();
301303
let flags = this.read_scalar(flags_op)?.to_i64()? as i32;
302304

303305
let at_empty_path = this.eval_libc_i32("AT_EMPTY_PATH")?;

0 commit comments

Comments
 (0)