File tree Expand file tree Collapse file tree 5 files changed +18
-4
lines changed Expand file tree Collapse file tree 5 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -696,7 +696,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
696696 retval_succ : Scalar ,
697697 retval_timeout : Scalar ,
698698 dest : MPlaceTy < ' tcx > ,
699- errno_timeout : Scalar ,
699+ errno_timeout : IoError ,
700700 ) {
701701 let this = self . eval_context_mut ( ) ;
702702 let thread = this. active_thread ( ) ;
@@ -713,7 +713,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
713713 retval_succ: Scalar ,
714714 retval_timeout: Scalar ,
715715 dest: MPlaceTy <' tcx>,
716- errno_timeout: Scalar ,
716+ errno_timeout: IoError ,
717717 }
718718 @unblock = |this| {
719719 let futex = this. machine. sync. futexes. get( & addr) . unwrap( ) ;
Original file line number Diff line number Diff line change @@ -89,6 +89,18 @@ impl VisitProvenance for Scalar {
8989 }
9090}
9191
92+ impl VisitProvenance for IoError {
93+ fn visit_provenance ( & self , visit : & mut VisitWith < ' _ > ) {
94+ use crate :: shims:: io_error:: IoError :: * ;
95+ match self {
96+ LibcError ( _name) => ( ) ,
97+ WindowsError ( _name) => ( ) ,
98+ HostError ( _io_error) => ( ) ,
99+ Raw ( scalar) => scalar. visit_provenance ( visit) ,
100+ }
101+ }
102+ }
103+
92104impl VisitProvenance for Immediate < Provenance > {
93105 fn visit_provenance ( & self , visit : & mut VisitWith < ' _ > ) {
94106 match self {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ use crate::*;
77#[ derive( Debug ) ]
88pub enum IoError {
99 LibcError ( & ' static str ) ,
10+ WindowsError ( & ' static str ) ,
1011 HostError ( io:: Error ) ,
1112 Raw ( Scalar ) ,
1213}
@@ -113,6 +114,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
113114 let errno = match err. into ( ) {
114115 HostError ( err) => this. io_error_to_errnum ( err) ?,
115116 LibcError ( name) => this. eval_libc ( name) ,
117+ WindowsError ( name) => this. eval_windows ( "c" , name) ,
116118 Raw ( val) => val,
117119 } ;
118120 let errno_place = this. last_error_place ( ) ?;
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ pub fn futex<'tcx>(
150150 Scalar :: from_target_isize ( 0 , this) , // retval_succ
151151 Scalar :: from_target_isize ( -1 , this) , // retval_timeout
152152 dest. clone ( ) ,
153- this . eval_libc ( "ETIMEDOUT" ) , // errno_timeout
153+ LibcError ( "ETIMEDOUT" ) , // errno_timeout
154154 ) ;
155155 } else {
156156 // The futex value doesn't match the expected value, so we return failure
Original file line number Diff line number Diff line change @@ -202,7 +202,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
202202 Scalar :: from_i32 ( 1 ) , // retval_succ
203203 Scalar :: from_i32 ( 0 ) , // retval_timeout
204204 dest. clone ( ) ,
205- this . eval_windows ( "c" , "ERROR_TIMEOUT" ) , // errno_timeout
205+ IoError :: WindowsError ( "ERROR_TIMEOUT" ) , // errno_timeout
206206 ) ;
207207 }
208208
You can’t perform that action at this time.
0 commit comments