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

Allow overwriting the panic_fmt language item #513

Closed
mahkoh opened this issue Dec 10, 2014 · 1 comment
Closed

Allow overwriting the panic_fmt language item #513

mahkoh opened this issue Dec 10, 2014 · 1 comment

Comments

@mahkoh
Copy link
Contributor

mahkoh commented Dec 10, 2014

If an executable uses a library that is not unwind-safe, the user has to guarantee that the executable does not unwind into the library. The only way to do this reliably is to turn unwinding into aborting. This can be done by overwriting the panic_fmt language item like this:

#[lang = "panic_fmt"]
pub extern fn rust_begin_unwind(_: &fmt::Arguments, _: &'static str, _: uint) -> ! {
    unsafe { intrinsics::abort() }
}

cc #512

@steveklabnik
Copy link
Member

We now have the ability to compile panics into aborts #1513

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants