@@ -80,7 +80,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
8080 let event = EpollEvent { events, data } ;
8181
8282 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`" ) ) ?;
8487
8588 epfd. file_descriptors . insert ( fd, event) ;
8689 Ok ( Scalar :: from_i32 ( 0 ) )
@@ -89,7 +92,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
8992 }
9093 } else if op == epoll_ctl_del {
9194 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`" ) ) ?;
9399
94100 epfd. file_descriptors . remove ( & fd) ;
95101 Ok ( Scalar :: from_i32 ( 0 ) )
@@ -148,7 +154,10 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriInterpCxExt<'mir, 'tcx> {
148154
149155 let numevents = 0 ;
150156 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`" ) ) ?;
152161
153162 // FIXME return number of events ready when scheme for marking events ready exists
154163 Ok ( Scalar :: from_i32 ( numevents) )
0 commit comments