Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permit unwinding through FFI by default #62603

Open
wants to merge 3 commits into
base: master
from

Conversation

@cuviper
Copy link
Member

commented Jul 11, 2019

This repeats #62505 for master (Rust 1.38+), as #58794 is not yet resolved. This is a stopgap until a stable alternative is available, like RFC 2699, as long as progress is being made to that end.

r? @joshtriplett

@RalfJung

This comment has been minimized.

Copy link
Member

commented Jul 13, 2019

To be clear, this allows extern C functions to unwind and it does not set the nounwind attribute for them? So there's lots of platform-specific concerns, but at least not outright UB?

@cuviper

This comment has been minimized.

Copy link
Member Author

commented Jul 18, 2019

@RalfJung no, this has no effect on the nounwind attribute, maintaining the (questionable) status quo that we've been releasing with so far. The only effect here is whether we add a cleanup block to non-Rust-ABI functions, so it forces an abort on panic/unwinding.

I believe nounwind is controlled here:

if cx.tcx.is_foreign_item(id) {
// Foreign items like `extern "C" { fn foo(); }` are assumed not to
// unwind
false
} else if sig.abi != Abi::Rust && sig.abi != Abi::RustCall {
// Any items defined in Rust that *don't* have the `extern` ABI are
// defined to not unwind. We insert shims to abort if an unwind
// happens to enforce this.
false

@bors

This comment has been minimized.

Copy link
Contributor

commented Jul 27, 2019

☔️ The latest upstream changes (presumably #63029) made this pull request unmergeable. Please resolve the merge conflicts.

@cuviper cuviper force-pushed the cuviper:no-unwind-abort branch from 8320809 to 699b1c2 Jul 31, 2019

@cuviper

This comment has been minimized.

Copy link
Member Author

commented Jul 31, 2019

Rebased.

@Alexendoo

This comment has been minimized.

Copy link
Member

commented Aug 7, 2019

Ping from triage: Any updates? @joshtriplett

@cuviper

This comment has been minimized.

Copy link
Member Author

commented Aug 13, 2019

A new beta 1.38 has branched -- @joshtriplett what's your preference here? Are we ready to land this on master and then nominate for beta? Or should I do another beta-targeted PR?

@bors

This comment has been minimized.

Copy link
Contributor

commented Aug 16, 2019

☔️ The latest upstream changes (presumably #63627) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.