Skip to content

Commit 2bdf163

Browse files
committed
Auto merge of #1053 - RalfJung:clean, r=RalfJung
remove no-longer-needed zero checks
2 parents bf96b47 + c790317 commit 2bdf163

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/shims/fs.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
175175
.to_machine_usize(&*this.tcx)?
176176
.min((1 << (ptr_size - 1)) - 1) // max value of target `isize`
177177
.min(isize::max_value() as u64);
178-
// Reading zero bytes should not change `buf`.
179-
if count == 0 {
180-
return Ok(0);
181-
}
178+
182179
let fd = this.read_scalar(fd_op)?.to_i32()?;
183180
let buf = this.read_scalar(buf_op)?.not_undef()?;
184181

@@ -231,10 +228,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
231228
.to_machine_usize(&*this.tcx)?
232229
.min((1 << (ptr_size - 1)) - 1) // max value of target `isize`
233230
.min(isize::max_value() as u64);
234-
// Writing zero bytes should not change `buf`.
235-
if count == 0 {
236-
return Ok(0);
237-
}
231+
238232
let fd = this.read_scalar(fd_op)?.to_i32()?;
239233
let buf = this.read_scalar(buf_op)?.not_undef()?;
240234

0 commit comments

Comments
 (0)