[LLVM 4.0] Set EH personality when resuming stack unwinding#37862
[LLVM 4.0] Set EH personality when resuming stack unwinding#37862bors merged 1 commit intorust-lang:masterfrom
Conversation
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).
|
/cc @dylanmckay |
|
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
|
r? @eddy |
|
I feel like I've seen @alexcrichton's name on exception-handling related stuff as well. |
|
Seems fine to me, but I'm not too familiar with MIR trans. I'd probably imagine this'd happen somewhere where the r? @eddyb |
|
@bors r+ |
|
📌 Commit 84415ea has been approved by |
| bcx.cleanup_ret(cleanup_pad, None); | ||
| } else { | ||
| let llpersonality = bcx.fcx().eh_personality(); | ||
| bcx.set_personality_fn(llpersonality); |
There was a problem hiding this comment.
I believe I said already in #36895, this code seems dubiously workaround-ish. Can we fix this properly, by fixing (if its not enough) up in the function near line 80.
There was a problem hiding this comment.
Namely, resume should not be translated in any case where there isn’t an unwind/invoke edge. And any unwind/invoke ought to already be setting the personality_fn.
There was a problem hiding this comment.
I said already in #36895,
Apologies; I wasn't CCed on that PR, so didn't know there were already reviews :-)
… 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).
To resume stack unwinding, the LLVM
resumeinstruction 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.