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