]> git.lizzy.rs Git - rust.git/commitdiff
also indicate abort via new MachineStop variant
authorRalf Jung <post@ralfj.de>
Mon, 2 Dec 2019 08:13:58 +0000 (09:13 +0100)
committerRalf Jung <post@ralfj.de>
Mon, 2 Dec 2019 08:13:58 +0000 (09:13 +0100)
src/eval.rs
src/shims/intrinsics.rs
tests/compile-fail/double_panic.rs

index 2c165760418f46c4f6ccd46ea1e265e8f854121f..dbb14b7bb189a2ebd72cbf31cdad430b664bd883 100644 (file)
@@ -212,7 +212,7 @@ pub fn eval_main<'tcx>(tcx: TyCtxt<'tcx>, main_id: DefId, config: MiriConfig) ->
                     match info {
                         TerminationInfo::Exit(code) => return Some(*code),
                         TerminationInfo::Abort =>
-                            format!("The program aborted execution")
+                            format!("the evaluated program aborted execution")
                     }
                 }
                 err_unsup!(NoMirFor(..)) =>
index 00886328030bbc035a61a5091b00422877828309..0cb51d593199ea83fe0bb2971ae24793d09ea30d 100644 (file)
@@ -34,9 +34,8 @@ fn call_intrinsic(
         // Handle diverging intrinsics.
         let (dest, ret) = match intrinsic_name {
             "abort" => {
-                // FIXME: Add a better way of indicating 'abnormal' termination,
-                // since this is not really an 'unsupported' behavior
-                throw_unsup_format!("the evaluated program aborted!");
+                let ti = Box::new(TerminationInfo::Abort);
+                return Err(InterpError::MachineStop(ti).into());
             }
             "miri_start_panic" => return this.handle_miri_start_panic(args, unwind),
             _ => {
index 950d865c2a5624712e68ed6bc6ea683b00c28b96..759762196b758ffa17f3ec7f26a93403b7a55f1a 100644 (file)
@@ -1,4 +1,4 @@
- //error-pattern: the evaluated program aborted
+ // error-pattern: the evaluated program aborted
 struct Foo;
 impl Drop for Foo {
     fn drop(&mut self) {