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> {
696
696
retval_succ : Scalar ,
697
697
retval_timeout : Scalar ,
698
698
dest : MPlaceTy < ' tcx > ,
699
- errno_timeout : Scalar ,
699
+ errno_timeout : IoError ,
700
700
) {
701
701
let this = self . eval_context_mut ( ) ;
702
702
let thread = this. active_thread ( ) ;
@@ -713,7 +713,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
713
713
retval_succ: Scalar ,
714
714
retval_timeout: Scalar ,
715
715
dest: MPlaceTy <' tcx>,
716
- errno_timeout: Scalar ,
716
+ errno_timeout: IoError ,
717
717
}
718
718
@unblock = |this| {
719
719
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 {
89
89
}
90
90
}
91
91
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
+
92
104
impl VisitProvenance for Immediate < Provenance > {
93
105
fn visit_provenance ( & self , visit : & mut VisitWith < ' _ > ) {
94
106
match self {
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ use crate::*;
7
7
#[ derive( Debug ) ]
8
8
pub enum IoError {
9
9
LibcError ( & ' static str ) ,
10
+ WindowsError ( & ' static str ) ,
10
11
HostError ( io:: Error ) ,
11
12
Raw ( Scalar ) ,
12
13
}
@@ -113,6 +114,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
113
114
let errno = match err. into ( ) {
114
115
HostError ( err) => this. io_error_to_errnum ( err) ?,
115
116
LibcError ( name) => this. eval_libc ( name) ,
117
+ WindowsError ( name) => this. eval_windows ( "c" , name) ,
116
118
Raw ( val) => val,
117
119
} ;
118
120
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>(
150
150
Scalar :: from_target_isize ( 0 , this) , // retval_succ
151
151
Scalar :: from_target_isize ( -1 , this) , // retval_timeout
152
152
dest. clone ( ) ,
153
- this . eval_libc ( "ETIMEDOUT" ) , // errno_timeout
153
+ LibcError ( "ETIMEDOUT" ) , // errno_timeout
154
154
) ;
155
155
} else {
156
156
// 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> {
202
202
Scalar :: from_i32 ( 1 ) , // retval_succ
203
203
Scalar :: from_i32 ( 0 ) , // retval_timeout
204
204
dest. clone ( ) ,
205
- this . eval_windows ( "c" , "ERROR_TIMEOUT" ) , // errno_timeout
205
+ IoError :: WindowsError ( "ERROR_TIMEOUT" ) , // errno_timeout
206
206
) ;
207
207
}
208
208
You can’t perform that action at this time.
0 commit comments