Skip to content

Commit 1c0004e

Browse files
committed
Pass dest place to read
1 parent db83e2d commit 1c0004e

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

src/shims/unix/fd.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ pub trait FileDescription: std::fmt::Debug + Any {
3232
_communicate_allowed: bool,
3333
_bytes: &mut [u8],
3434
_ptr: Pointer,
35+
_dest: &MPlaceTy<'tcx>,
3536
_ecx: &mut MiriInterpCx<'tcx>,
3637
) -> InterpResult<'tcx, io::Result<usize>> {
3738
throw_unsup_format!("cannot read from {}", self.name());
@@ -128,6 +129,7 @@ impl FileDescription for io::Stdin {
128129
communicate_allowed: bool,
129130
bytes: &mut [u8],
130131
_ptr: Pointer,
132+
_dest: &MPlaceTy<'tcx>,
131133
_ecx: &mut MiriInterpCx<'tcx>,
132134
) -> InterpResult<'tcx, io::Result<usize>> {
133135
if !communicate_allowed {
@@ -571,7 +573,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
571573

572574
let mut bytes = vec![0; usize::try_from(count).unwrap()];
573575
let result = match offset {
574-
None => fd.read(&fd, communicate, &mut bytes, buf, this),
576+
None => fd.read(&fd, communicate, &mut bytes, buf, dest, this),
575577
Some(offset) => {
576578
let Ok(offset) = u64::try_from(offset) else {
577579
let einval = this.eval_libc("EINVAL");

src/shims/unix/fs.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ impl FileDescription for FileHandle {
3636
communicate_allowed: bool,
3737
bytes: &mut [u8],
3838
_ptr: Pointer,
39+
_dest: &MPlaceTy<'tcx>,
3940
_ecx: &mut MiriInterpCx<'tcx>,
4041
) -> InterpResult<'tcx, io::Result<usize>> {
4142
assert!(communicate_allowed, "isolation should have prevented even opening a file");

src/shims/unix/linux/eventfd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ impl FileDescription for Event {
6464
_communicate_allowed: bool,
6565
bytes: &mut [u8],
6666
_ptr: Pointer,
67+
_dest: &MPlaceTy<'tcx>,
6768
ecx: &mut MiriInterpCx<'tcx>,
6869
) -> InterpResult<'tcx, io::Result<usize>> {
6970
// Check the size of slice, and return error only if the size of the slice < 8.

src/shims/unix/unnamed_socket.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ impl FileDescription for AnonSocket {
128128
_communicate_allowed: bool,
129129
bytes: &mut [u8],
130130
_ptr: Pointer,
131+
_dest: &MPlaceTy<'tcx>,
131132
ecx: &mut MiriInterpCx<'tcx>,
132133
) -> InterpResult<'tcx, io::Result<usize>> {
133134
let request_byte_size = bytes.len();

0 commit comments

Comments
 (0)