File tree 3 files changed +8
-4
lines changed
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
141
141
interp_ok ( Scalar :: from_i32 ( -1 ) )
142
142
}
143
143
144
- /// Sets the last OS error and return `-1` as a `i32 `-typed Scalar
144
+ /// Sets the last OS error and return `-1` as a `i64 `-typed Scalar
145
145
fn set_last_error_and_return_i64 (
146
146
& mut self ,
147
147
err : impl Into < IoError > ,
Original file line number Diff line number Diff line change @@ -562,7 +562,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
562
562
fn fd_not_found < T : From < i32 > > ( & mut self ) -> InterpResult < ' tcx , T > {
563
563
let this = self . eval_context_mut ( ) ;
564
564
this. set_last_error ( LibcError ( "EBADF" ) ) ?;
565
- Ok ( ( -1 ) . into ( ) )
565
+ interp_ok ( ( -1 ) . into ( ) )
566
566
}
567
567
568
568
/// Read data from `fd` into buffer specified by `buf` and `count`.
Original file line number Diff line number Diff line change @@ -1411,7 +1411,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
1411
1411
// Reject if isolation is enabled.
1412
1412
if let IsolatedOp :: Reject ( reject_with) = this. machine . isolated_op {
1413
1413
this. reject_in_isolation ( "`readlink`" , reject_with) ?;
1414
- return this. set_last_error_and_return_i64 ( LibcError ( "EACCES" ) ) ;
1414
+ this. set_last_error ( LibcError ( "EACCES" ) ) ?;
1415
+ return interp_ok ( -1 ) ;
1415
1416
}
1416
1417
1417
1418
let result = std:: fs:: read_link ( pathname) ;
@@ -1432,7 +1433,10 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
1432
1433
this. write_bytes_ptr ( buf, path_bytes. iter ( ) . copied ( ) ) ?;
1433
1434
interp_ok ( path_bytes. len ( ) . try_into ( ) . unwrap ( ) )
1434
1435
}
1435
- Err ( e) => this. set_last_error_and_return_i64 ( e) ,
1436
+ Err ( e) => {
1437
+ this. set_last_error ( e) ?;
1438
+ interp_ok ( -1 )
1439
+ }
1436
1440
}
1437
1441
}
1438
1442
You can’t perform that action at this time.
0 commit comments