@@ -80,7 +80,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
80
80
let event = EpollEvent { events, data } ;
81
81
82
82
if let Some ( epfd) = this. machine . file_handler . handles . get_mut ( & epfd) {
83
- let epfd = epfd. as_epoll_handle ( ) ?;
83
+ let epfd = epfd
84
+ . as_any_mut ( )
85
+ . downcast_mut :: < Epoll > ( )
86
+ . ok_or_else ( || err_unsup_format ! ( "non-epoll FD passed to `epoll_ctl`" ) ) ?;
84
87
85
88
epfd. file_descriptors . insert ( fd, event) ;
86
89
Ok ( Scalar :: from_i32 ( 0 ) )
@@ -89,7 +92,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
89
92
}
90
93
} else if op == epoll_ctl_del {
91
94
if let Some ( epfd) = this. machine . file_handler . handles . get_mut ( & epfd) {
92
- let epfd = epfd. as_epoll_handle ( ) ?;
95
+ let epfd = epfd
96
+ . as_any_mut ( )
97
+ . downcast_mut :: < Epoll > ( )
98
+ . ok_or_else ( || err_unsup_format ! ( "non-epoll FD passed to `epoll_ctl`" ) ) ?;
93
99
94
100
epfd. file_descriptors . remove ( & fd) ;
95
101
Ok ( Scalar :: from_i32 ( 0 ) )
@@ -148,7 +154,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
148
154
149
155
let numevents = 0 ;
150
156
if let Some ( epfd) = this. machine . file_handler . handles . get_mut ( & epfd) {
151
- let _epfd = epfd. as_epoll_handle ( ) ?;
157
+ let _epfd = epfd
158
+ . as_any_mut ( )
159
+ . downcast_mut :: < Epoll > ( )
160
+ . ok_or_else ( || err_unsup_format ! ( "non-epoll FD passed to `epoll_wait`" ) ) ?;
152
161
153
162
// FIXME return number of events ready when scheme for marking events ready exists
154
163
Ok ( Scalar :: from_i32 ( numevents) )
0 commit comments