Skip to content

Commit

Permalink
Auto merge of #37862 - shepmaster:llvm-4.0-always-set-eh-personality,…
Browse files Browse the repository at this point in the history
… r=eddyb

[LLVM 4.0] Set EH personality when resuming stack unwinding

To resume stack unwinding, the LLVM `resume` instruction must be used.

In order to use this instruction, the calling function must have an
exception handling personality set.

LLVM 4.0 adds a new IR validation check to ensure a personality is
always set in these cases.

This was introduced in [r277360](https://reviews.llvm.org/rL277360).
  • Loading branch information
bors authored Nov 20, 2016
2 parents fb12219 + 84415ea commit 4bc9290
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/librustc_trans/mir/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
if let Some(cleanup_pad) = cleanup_pad {
bcx.cleanup_ret(cleanup_pad, None);
} else {
let llpersonality = bcx.fcx().eh_personality();
bcx.set_personality_fn(llpersonality);

let ps = self.get_personality_slot(&bcx);
let lp = bcx.load(ps);
bcx.with_block(|bcx| {
Expand Down

0 comments on commit 4bc9290

Please sign in to comment.