@@ -590,7 +590,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
590
590
let Ok ( offset) = u64:: try_from ( offset) else {
591
591
let einval = this. eval_libc ( "EINVAL" ) ;
592
592
this. set_last_error ( einval) ?;
593
- this. write_scalar ( Scalar :: from_target_isize ( - 1 , this ) , dest) ?;
593
+ this. write_int ( - 1 , dest) ?;
594
594
return Ok ( ( ) ) ;
595
595
} ;
596
596
fd. pread ( communicate, & mut bytes, offset, buf, dest, this) ?
@@ -635,8 +635,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
635
635
let Ok ( offset) = u64:: try_from ( offset) else {
636
636
let einval = this. eval_libc ( "EINVAL" ) ;
637
637
this. set_last_error ( einval) ?;
638
- let res = Scalar :: from_target_isize ( -1 , this) ;
639
- this. write_scalar ( res, dest) ?;
638
+ this. write_int ( -1 , dest) ?;
640
639
return Ok ( ( ) ) ;
641
640
} ;
642
641
fd. pwrite ( communicate, & bytes, offset, dest, this) ?
@@ -667,12 +666,12 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
667
666
buf,
668
667
bytes[ ..usize:: try_from ( read_bytes) . unwrap ( ) ] . iter ( ) . copied ( ) ,
669
668
) ?;
670
- this. write_scalar ( Scalar :: from_target_isize ( read_bytes, this ) , dest) ?;
669
+ this. write_int ( read_bytes, dest) ?;
671
670
return Ok ( ( ) ) ;
672
671
}
673
672
Err ( e) => {
674
673
this. set_last_error_from_io_error ( e) ?;
675
- this. write_scalar ( Scalar :: from_target_isize ( - 1 , this ) , dest) ?;
674
+ this. write_int ( - 1 , dest) ?;
676
675
return Ok ( ( ) ) ;
677
676
}
678
677
}
@@ -685,7 +684,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
685
684
) -> InterpResult < ' tcx > {
686
685
let this = self . eval_context_mut ( ) ;
687
686
let result = this. try_unwrap_io_result ( result?. map ( |c| i64:: try_from ( c) . unwrap ( ) ) ) ?;
688
- this. write_scalar ( Scalar :: from_target_isize ( result, this ) , dest) ?;
687
+ this. write_int ( result, dest) ?;
689
688
Ok ( ( ) )
690
689
}
691
690
}
0 commit comments