Skip to content

Commit 995887d

Browse files
committed
Clean up remaining write_scalar
1 parent 633430a commit 995887d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/shims/unix/fd.rs

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

@@ -625,8 +625,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
625625
let bytes = this.read_bytes_ptr_strip_provenance(buf, Size::from_bytes(count))?.to_owned();
626626
// We temporarily dup the FD to be able to retain mutable access to `this`.
627627
let Some(fd) = this.machine.fds.get(fd) else {
628-
let res = this.fd_not_found()?;
629-
this.write_scalar(Scalar::from_target_isize(res, this), dest)?;
628+
let res: i32 = this.fd_not_found()?;
629+
this.write_int(res, dest)?;
630630
return Ok(());
631631
};
632632

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)