@@ -35,9 +35,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
3535 ) -> InterpResult < ' tcx , i32 > {
3636 let this = self . eval_context_mut ( ) ;
3737
38- if !this. machine . communicate {
39- throw_unsup_format ! ( "`open` not available when isolation is enabled" )
40- }
38+ this. check_no_isolation ( "open" ) ?;
4139
4240 let flag = this. read_scalar ( flag_op) ?. to_i32 ( ) ?;
4341
@@ -120,9 +118,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
120118 ) -> InterpResult < ' tcx , i32 > {
121119 let this = self . eval_context_mut ( ) ;
122120
123- if !this. machine . communicate {
124- throw_unsup_format ! ( "`fcntl` not available when isolation is enabled" )
125- }
121+ this. check_no_isolation ( "fcntl" ) ?;
126122
127123 let fd = this. read_scalar ( fd_op) ?. to_i32 ( ) ?;
128124 let cmd = this. read_scalar ( cmd_op) ?. to_i32 ( ) ?;
@@ -142,9 +138,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
142138 fn close ( & mut self , fd_op : OpTy < ' tcx , Tag > ) -> InterpResult < ' tcx , i32 > {
143139 let this = self . eval_context_mut ( ) ;
144140
145- if !this. machine . communicate {
146- throw_unsup_format ! ( "`close` not available when isolation is enabled" )
147- }
141+ this. check_no_isolation ( "close" ) ?;
148142
149143 let fd = this. read_scalar ( fd_op) ?. to_i32 ( ) ?;
150144
@@ -161,9 +155,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
161155 ) -> InterpResult < ' tcx , i64 > {
162156 let this = self . eval_context_mut ( ) ;
163157
164- if !this. machine . communicate {
165- throw_unsup_format ! ( "`read` not available when isolation is enabled" )
166- }
158+ this. check_no_isolation ( "read" ) ?;
167159
168160 let tcx = & { this. tcx . tcx } ;
169161
@@ -198,9 +190,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
198190 ) -> InterpResult < ' tcx , i64 > {
199191 let this = self . eval_context_mut ( ) ;
200192
201- if !this. machine . communicate {
202- throw_unsup_format ! ( "`write` not available when isolation is enabled" )
203- }
193+ this. check_no_isolation ( "write" ) ?;
204194
205195 let tcx = & { this. tcx . tcx } ;
206196
@@ -226,9 +216,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
226216 fn unlink ( & mut self , path_op : OpTy < ' tcx , Tag > ) -> InterpResult < ' tcx , i32 > {
227217 let this = self . eval_context_mut ( ) ;
228218
229- if !this. machine . communicate {
230- throw_unsup_format ! ( "`write` not available when isolation is enabled" )
231- }
219+ this. check_no_isolation ( "unlink" ) ?;
232220
233221 let path_bytes = this
234222 . memory ( )
0 commit comments