Skip to content

Commit 806de7d

Browse files
author
Dylan McKay
committed
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).
1 parent 5045d4e commit 806de7d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc_trans/mir/block.rs

+3
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ impl<'bcx, 'tcx> MirContext<'bcx, 'tcx> {
115115
if let Some(cleanup_pad) = cleanup_pad {
116116
bcx.cleanup_ret(cleanup_pad, None);
117117
} else {
118+
let llpersonality = bcx.fcx.eh_personality();
119+
bcx.set_personality_fn(llpersonality);
120+
118121
let ps = self.get_personality_slot(&bcx);
119122
let lp = bcx.load(ps);
120123
bcx.with_block(|bcx| {

0 commit comments

Comments
 (0)