Skip to content

Commit d05a38f

Browse files
committed
Add a peer_lost_data field to AnonSocket struct
1 parent df9c34a commit d05a38f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/shims/unix/unnamed_socket.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,13 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
294294
let fd0 = fds.new_ref(AnonSocket {
295295
readbuf: Some(RefCell::new(Buffer::new())),
296296
peer_fd: OnceCell::new(),
297+
peer_lost_data: Cell::new(false),
297298
is_nonblock: is_sock_nonblock,
298299
});
299300
let fd1 = fds.new_ref(AnonSocket {
300301
readbuf: Some(RefCell::new(Buffer::new())),
301302
peer_fd: OnceCell::new(),
303+
peer_lost_data: Cell::new(false),
302304
is_nonblock: is_sock_nonblock,
303305
});
304306

@@ -344,10 +346,15 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
344346
let fd0 = fds.new_ref(AnonSocket {
345347
readbuf: Some(RefCell::new(Buffer::new())),
346348
peer_fd: OnceCell::new(),
349+
peer_lost_data: Cell::new(false),
350+
is_nonblock: false,
351+
});
352+
let fd1 = fds.new_ref(AnonSocket {
353+
readbuf: None,
354+
peer_fd: OnceCell::new(),
355+
peer_lost_data: Cell::new(false),
347356
is_nonblock: false,
348357
});
349-
let fd1 =
350-
fds.new_ref(AnonSocket { readbuf: None, peer_fd: OnceCell::new(), is_nonblock: false });
351358

352359
// Make the file descriptions point to each other.
353360
fd0.downcast::<AnonSocket>().unwrap().peer_fd.set(fd1.downgrade()).unwrap();

0 commit comments

Comments
 (0)