@@ -337,8 +337,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
337337 Err ( e) => this. set_last_error_from_io_error ( e) ?,
338338 }
339339 } else {
340- // Emulate an error in isolation mode
341- let err = Error :: new ( ErrorKind :: NotFound , "`getcwd` not available in isolation mode" ) ;
340+ // Return a dummy error in isolation mode, after printing a warning about it.
341+ this. warn_foreign_in_isolation ( "getcwd" ) ;
342+ let err = Error :: new ( ErrorKind :: NotFound , "dummy error in isolation mode" ) ;
342343 this. set_last_error_from_io_error ( err) ?;
343344 }
344345 Ok ( Scalar :: null_ptr ( & * this. tcx ) )
@@ -364,8 +365,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
364365 Err ( e) => this. set_last_error_from_io_error ( e) ?,
365366 }
366367 } else {
367- // Emulate an error in isolation mode
368- let err = Error :: new ( ErrorKind :: NotFound , "`GetCurrentDirectoryW` not available in isolation mode" ) ;
368+ // Return a dummy error in isolation mode, after printing a warning about it.
369+ this. warn_foreign_in_isolation ( "GetCurrentDirectoryW" ) ;
370+ let err = Error :: new ( ErrorKind :: NotFound , "dummy error in isolation mode" ) ;
369371 this. set_last_error_from_io_error ( err) ?;
370372 }
371373 Ok ( 0 )
@@ -390,9 +392,11 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
390392 }
391393 }
392394 } else {
393- // Emulate an error in isolation mode
394- let err = Error :: new ( ErrorKind :: NotFound , "`chdir` not available in isolation mode" ) ;
395+ // Return a dummy error in isolation mode, after printing a warning about it.
396+ this. warn_foreign_in_isolation ( "chdir" ) ;
397+ let err = Error :: new ( ErrorKind :: NotFound , "dummy error in isolation mode" ) ;
395398 this. set_last_error_from_io_error ( err) ?;
399+
396400 Ok ( -1 )
397401 }
398402 }
@@ -418,8 +422,9 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
418422 }
419423 }
420424 } else {
421- // Emulate an error in isolation mode
422- let err = Error :: new ( ErrorKind :: NotFound , "`SetCurrentDirectoryW` not available in isolation mode" ) ;
425+ // Return a dummy error in isolation mode, after printing a warning about it.
426+ this. warn_foreign_in_isolation ( "SetCurrentDirectoryW" ) ;
427+ let err = Error :: new ( ErrorKind :: NotFound , "dummy error in isolation mode" ) ;
423428 this. set_last_error_from_io_error ( err) ?;
424429 Ok ( 0 )
425430 }
0 commit comments