Skip to content

Commit dcdd68b

Browse files
committed
also indicate abort via new MachineStop variant
1 parent 1c420b0 commit dcdd68b

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/eval.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ pub fn eval_main<'tcx>(tcx: TyCtxt<'tcx>, main_id: DefId, config: MiriConfig) ->
212212
match info {
213213
TerminationInfo::Exit(code) => return Some(*code),
214214
TerminationInfo::Abort =>
215-
format!("The program aborted execution")
215+
format!("the evaluated program aborted execution")
216216
}
217217
}
218218
err_unsup!(NoMirFor(..)) =>

src/shims/intrinsics.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
3434
// Handle diverging intrinsics.
3535
let (dest, ret) = match intrinsic_name {
3636
"abort" => {
37-
// FIXME: Add a better way of indicating 'abnormal' termination,
38-
// since this is not really an 'unsupported' behavior
39-
throw_unsup_format!("the evaluated program aborted!");
37+
let ti = Box::new(TerminationInfo::Abort);
38+
return Err(InterpError::MachineStop(ti).into());
4039
}
4140
"miri_start_panic" => return this.handle_miri_start_panic(args, unwind),
4241
_ => {

tests/compile-fail/double_panic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//error-pattern: the evaluated program aborted
1+
// error-pattern: the evaluated program aborted
22
struct Foo;
33
impl Drop for Foo {
44
fn drop(&mut self) {

0 commit comments

Comments
 (0)