@@ -35,9 +35,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
35
35
) -> InterpResult < ' tcx , i32 > {
36
36
let this = self . eval_context_mut ( ) ;
37
37
38
- if !this. machine . communicate {
39
- throw_unsup_format ! ( "`open` not available when isolation is enabled" )
40
- }
38
+ this. check_no_isolation ( "open" ) ?;
41
39
42
40
let flag = this. read_scalar ( flag_op) ?. to_i32 ( ) ?;
43
41
@@ -120,9 +118,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
120
118
) -> InterpResult < ' tcx , i32 > {
121
119
let this = self . eval_context_mut ( ) ;
122
120
123
- if !this. machine . communicate {
124
- throw_unsup_format ! ( "`fcntl` not available when isolation is enabled" )
125
- }
121
+ this. check_no_isolation ( "fcntl" ) ?;
126
122
127
123
let fd = this. read_scalar ( fd_op) ?. to_i32 ( ) ?;
128
124
let cmd = this. read_scalar ( cmd_op) ?. to_i32 ( ) ?;
@@ -142,9 +138,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
142
138
fn close ( & mut self , fd_op : OpTy < ' tcx , Tag > ) -> InterpResult < ' tcx , i32 > {
143
139
let this = self . eval_context_mut ( ) ;
144
140
145
- if !this. machine . communicate {
146
- throw_unsup_format ! ( "`close` not available when isolation is enabled" )
147
- }
141
+ this. check_no_isolation ( "close" ) ?;
148
142
149
143
let fd = this. read_scalar ( fd_op) ?. to_i32 ( ) ?;
150
144
@@ -161,9 +155,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
161
155
) -> InterpResult < ' tcx , i64 > {
162
156
let this = self . eval_context_mut ( ) ;
163
157
164
- if !this. machine . communicate {
165
- throw_unsup_format ! ( "`read` not available when isolation is enabled" )
166
- }
158
+ this. check_no_isolation ( "read" ) ?;
167
159
168
160
let tcx = & { this. tcx . tcx } ;
169
161
@@ -198,9 +190,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
198
190
) -> InterpResult < ' tcx , i64 > {
199
191
let this = self . eval_context_mut ( ) ;
200
192
201
- if !this. machine . communicate {
202
- throw_unsup_format ! ( "`write` not available when isolation is enabled" )
203
- }
193
+ this. check_no_isolation ( "write" ) ?;
204
194
205
195
let tcx = & { this. tcx . tcx } ;
206
196
@@ -226,9 +216,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
226
216
fn unlink ( & mut self , path_op : OpTy < ' tcx , Tag > ) -> InterpResult < ' tcx , i32 > {
227
217
let this = self . eval_context_mut ( ) ;
228
218
229
- if !this. machine . communicate {
230
- throw_unsup_format ! ( "`write` not available when isolation is enabled" )
231
- }
219
+ this. check_no_isolation ( "unlink" ) ?;
232
220
233
221
let path_bytes = this
234
222
. memory ( )
0 commit comments