@@ -36,9 +36,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
36
36
) -> InterpResult < ' tcx , i32 > {
37
37
let this = self . eval_context_mut ( ) ;
38
38
39
- if !this. machine . communicate {
40
- throw_unsup_format ! ( "`open` not available when isolation is enabled" )
41
- }
39
+ this. check_no_isolation ( "open" ) ?;
42
40
43
41
let flag = this. read_scalar ( flag_op) ?. to_i32 ( ) ?;
44
42
@@ -91,9 +89,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
91
89
) -> InterpResult < ' tcx , i32 > {
92
90
let this = self . eval_context_mut ( ) ;
93
91
94
- if !this. machine . communicate {
95
- throw_unsup_format ! ( "`fcntl` not available when isolation is enabled" )
96
- }
92
+ this. check_no_isolation ( "fcntl" ) ?;
97
93
98
94
let fd = this. read_scalar ( fd_op) ?. to_i32 ( ) ?;
99
95
let cmd = this. read_scalar ( cmd_op) ?. to_i32 ( ) ?;
@@ -126,9 +122,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
126
122
fn close ( & mut self , fd_op : OpTy < ' tcx , Tag > ) -> InterpResult < ' tcx , i32 > {
127
123
let this = self . eval_context_mut ( ) ;
128
124
129
- if !this. machine . communicate {
130
- throw_unsup_format ! ( "`close` not available when isolation is enabled" )
131
- }
125
+ this. check_no_isolation ( "close" ) ?;
132
126
133
127
let fd = this. read_scalar ( fd_op) ?. to_i32 ( ) ?;
134
128
@@ -145,9 +139,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
145
139
) -> InterpResult < ' tcx , i64 > {
146
140
let this = self . eval_context_mut ( ) ;
147
141
148
- if !this. machine . communicate {
149
- throw_unsup_format ! ( "`read` not available when isolation is enabled" )
150
- }
142
+ this. check_no_isolation ( "read" ) ?;
151
143
152
144
let tcx = & { this. tcx . tcx } ;
153
145
@@ -182,9 +174,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
182
174
) -> InterpResult < ' tcx , i64 > {
183
175
let this = self . eval_context_mut ( ) ;
184
176
185
- if !this. machine . communicate {
186
- throw_unsup_format ! ( "`write` not available when isolation is enabled" )
187
- }
177
+ this. check_no_isolation ( "write" ) ?;
188
178
189
179
let tcx = & { this. tcx . tcx } ;
190
180
@@ -210,9 +200,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
210
200
fn unlink ( & mut self , path_op : OpTy < ' tcx , Tag > ) -> InterpResult < ' tcx , i32 > {
211
201
let this = self . eval_context_mut ( ) ;
212
202
213
- if !this. machine . communicate {
214
- throw_unsup_format ! ( "`write` not available when isolation is enabled" )
215
- }
203
+ this. check_no_isolation ( "unlink" ) ?;
216
204
217
205
let path_bytes = this
218
206
. memory ( )
0 commit comments