From c790317eb95c78af1e63dc0efcd4d447aa83ffc8 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 14 Nov 2019 10:29:43 +0100 Subject: [PATCH] remove no-longer-needed zero checks --- src/shims/fs.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/shims/fs.rs b/src/shims/fs.rs index 4de59ad32ff..79e57cf2c8f 100644 --- a/src/shims/fs.rs +++ b/src/shims/fs.rs @@ -175,10 +175,7 @@ fn read( .to_machine_usize(&*this.tcx)? .min((1 << (ptr_size - 1)) - 1) // max value of target `isize` .min(isize::max_value() as u64); - // Reading zero bytes should not change `buf`. - if count == 0 { - return Ok(0); - } + let fd = this.read_scalar(fd_op)?.to_i32()?; let buf = this.read_scalar(buf_op)?.not_undef()?; @@ -231,10 +228,7 @@ fn write( .to_machine_usize(&*this.tcx)? .min((1 << (ptr_size - 1)) - 1) // max value of target `isize` .min(isize::max_value() as u64); - // Writing zero bytes should not change `buf`. - if count == 0 { - return Ok(0); - } + let fd = this.read_scalar(fd_op)?.to_i32()?; let buf = this.read_scalar(buf_op)?.not_undef()?; -- 2.44.0