Skip to content

Commit 555898c

Browse files
committed
Clean up remaining write_scalar
1 parent af0bcc4 commit 555898c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/shims/unix/fd.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,8 +573,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
573573
// We temporarily dup the FD to be able to retain mutable access to `this`.
574574
let Some(fd) = this.machine.fds.get(fd_num) else {
575575
trace!("read: FD not found");
576-
let res = Scalar::from_target_isize(this.fd_not_found()?, this);
577-
this.write_scalar(res, dest)?;
576+
let res: i32 = this.fd_not_found()?;
577+
this.write_int(res, dest)?;
578578
return Ok(());
579579
};
580580

@@ -626,6 +626,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
626626
let Some(fd) = this.machine.fds.get(fd_num) else {
627627
let res = this.fd_not_found()?;
628628
this.write_scalar(Scalar::from_target_isize(res, this), dest)?;
629+
let Some(fd) = this.machine.fds.get(fd_num) else {
630+
let res: i32 = this.fd_not_found()?;
631+
this.write_int(res, dest)?;
629632
return Ok(());
630633
};
631634

src/shims/unix/linux/eventfd.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ impl FileDescription for Event {
7171
let Some(bytes) = bytes.first_chunk_mut::<U64_ARRAY_SIZE>() else {
7272
let result = Ok(Err(Error::from(ErrorKind::InvalidInput)));
7373
ecx.read_byte_helper(ptr, bytes.to_vec(), result, dest)?;
74-
// TODO: remove the usize later
7574
return Ok(());
7675
};
7776
// Block when counter == 0.

0 commit comments

Comments
 (0)