Skip to content

Commit 4c002e3

Browse files
committed
fix stray compiler errors after rebasing
1 parent 337fdf9 commit 4c002e3

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/shims/io_error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
141141
interp_ok(Scalar::from_i32(-1))
142142
}
143143

144-
/// Sets the last OS error and return `-1` as a `i32`-typed Scalar
144+
/// Sets the last OS error and return `-1` as a `i64`-typed Scalar
145145
fn set_last_error_and_return_i64(
146146
&mut self,
147147
err: impl Into<IoError>,

src/shims/unix/fd.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
562562
fn fd_not_found<T: From<i32>>(&mut self) -> InterpResult<'tcx, T> {
563563
let this = self.eval_context_mut();
564564
this.set_last_error(LibcError("EBADF"))?;
565-
Ok((-1).into())
565+
interp_ok((-1).into())
566566
}
567567

568568
/// Read data from `fd` into buffer specified by `buf` and `count`.

src/shims/unix/fs.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
14111411
// Reject if isolation is enabled.
14121412
if let IsolatedOp::Reject(reject_with) = this.machine.isolated_op {
14131413
this.reject_in_isolation("`readlink`", reject_with)?;
1414-
return this.set_last_error_and_return_i64(LibcError("EACCES"));
1414+
this.set_last_error(LibcError("EACCES"))?;
1415+
return interp_ok(-1);
14151416
}
14161417

14171418
let result = std::fs::read_link(pathname);
@@ -1432,7 +1433,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
14321433
this.write_bytes_ptr(buf, path_bytes.iter().copied())?;
14331434
interp_ok(path_bytes.len().try_into().unwrap())
14341435
}
1435-
Err(e) => this.set_last_error_and_return_i64(e),
1436+
Err(e) => {
1437+
this.set_last_error(e)?;
1438+
interp_ok(-1)
1439+
}
14361440
}
14371441
}
14381442

0 commit comments

Comments
 (0)