Skip to content

Commit 4a5cb2d

Browse files
committed
Some cleanup
1 parent bca04c7 commit 4a5cb2d

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/fn_call.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
216216
// 'payload'. This should help catch some basic errors in
217217
// the caller of this function, even in abort mode
218218
if this.tcx.tcx.sess.panic_strategy() == PanicStrategy::Abort {
219+
// FIXME: Actually print out the payload here
219220
return err!(MachineError("the evaluated program abort-panicked".to_string()));
220221
}
221222

@@ -1170,9 +1171,6 @@ fn unwind_stack<'a, 'mir, 'tcx>(
11701171
payload_data_ptr: Scalar<Borrow>,
11711172
payload_vtable_ptr: Scalar<Borrow>
11721173
) -> EvalResult<'tcx> {
1173-
1174-
let mut found = false;
1175-
11761174
while !this.stack().is_empty() {
11771175
// When '__rust_maybe_catch_panic' is called, it marks is frame
11781176
// with 'catch_panic'. When we find this marker, we've found
@@ -1201,9 +1199,8 @@ fn unwind_stack<'a, 'mir, 'tcx>(
12011199
// We're done - continue execution in the frame of the function
12021200
// that called '__rust_maybe_catch_panic,'
12031201
this.goto_block(Some(ret))?;
1204-
found = true;
12051202

1206-
break;
1203+
return Ok(())
12071204
} else {
12081205
// This frame is above our target frame on the call stack.
12091206
// We pop it off the stack, running its 'unwind' block if applicable
@@ -1232,9 +1229,7 @@ fn unwind_stack<'a, 'mir, 'tcx>(
12321229
}
12331230
}
12341231

1235-
if !found {
1236-
// The 'start_fn' lang item should always install a panic handler
1237-
return err!(Unreachable);
1238-
}
1239-
return Ok(())
1232+
// We should never get here:
1233+
// The 'start_fn' lang item should always install a panic handler
1234+
return err!(Unreachable);
12401235
}

0 commit comments

Comments
 (0)