File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -459,8 +459,13 @@ pub fn eval_entry<'tcx>(
459
459
ecx. handle_ice ( ) ;
460
460
panic:: resume_unwind ( panic_payload)
461
461
} ) ;
462
- // `Ok` can never happen.
462
+ // `Ok` can never happen; the interpreter loop always exits with an "error"
463
+ // (but that "error" might be just "regular program termination").
463
464
let Err ( err) = res. report_err ( ) ;
465
+ // Show diagnostic, if any.
466
+ let ( return_code, leak_check) = report_error ( & ecx, err) ?;
467
+
468
+ // If we get here there was no fatal error.
464
469
465
470
// Machine cleanup. Only do this if all threads have terminated; threads that are still running
466
471
// might cause Stacked Borrows errors (https://github.com/rust-lang/miri/issues/2396).
@@ -472,8 +477,7 @@ pub fn eval_entry<'tcx>(
472
477
EnvVars :: cleanup ( & mut ecx) . expect ( "error during env var cleanup" ) ;
473
478
}
474
479
475
- // Process the result.
476
- let ( return_code, leak_check) = report_error ( & ecx, err) ?;
480
+ // Possibly check for memory leaks.
477
481
if leak_check && !ignore_leaks {
478
482
// Check for thread leaks.
479
483
if !ecx. have_all_terminated ( ) {
You can’t perform that action at this time.
0 commit comments