@@ -379,7 +379,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
379
379
_ => throw_unsup_format ! ( "The {} error cannot be transformed into a raw os error" , e)
380
380
} ) ?
381
381
} else {
382
- // FIXME: we have to implement the windows' equivalent of this.
382
+ // FIXME: we have to implement the Windows equivalent of this.
383
383
throw_unsup_format ! ( "Setting the last OS error from an io::Error is unsupported for {}." , target. target_os)
384
384
} ;
385
385
this. set_last_error ( last_error)
@@ -390,7 +390,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
390
390
/// `Ok(-1)` and sets the last OS error accordingly.
391
391
///
392
392
/// This function uses `T: From<i32>` instead of `i32` directly because some IO related
393
- /// functions return different integer types (like `read`, that returns an `i64`)
393
+ /// functions return different integer types (like `read`, that returns an `i64`).
394
394
fn try_unwrap_io_result < T : From < i32 > > (
395
395
& mut self ,
396
396
result : std:: io:: Result < T > ,
@@ -423,11 +423,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
423
423
) -> InterpResult < ' tcx , bool > {
424
424
let bytes = os_str_to_bytes ( os_str) ?;
425
425
// If `size` is smaller or equal than `bytes.len()`, writing `bytes` plus the required null
426
- // terminator to memory using the `ptr` pointer would cause an overflow .
426
+ // terminator to memory using the `ptr` pointer would cause an out-of-bounds access .
427
427
if size <= bytes. len ( ) as u64 {
428
428
return Ok ( false ) ;
429
429
}
430
- // FIXME: We should use `Iterator::chain` instead when rust-lang/rust#65704 lands.
431
430
self . eval_context_mut ( ) . memory . write_bytes ( scalar, bytes. iter ( ) . copied ( ) . chain ( iter:: once ( 0u8 ) ) ) ?;
432
431
Ok ( true )
433
432
}
0 commit comments