firmware: mark __artiq_{re,}raise as #[unwind].

This is required for correctness.
This commit is contained in:
whitequark 2017-02-05 09:04:22 +00:00
parent 6d094eda32
commit 25c9b8827a
3 changed files with 4 additions and 2 deletions

View File

@ -407,6 +407,7 @@ static mut INFLIGHT: ExceptionInfo = ExceptionInfo {
};
#[export_name="__artiq_raise"]
#[unwind]
pub unsafe extern fn raise(exception: *const Exception) -> ! {
// Zing! The Exception<'a> as Exception<'static> cast is not really sound in case
// the exception is ever captured. Fortunately, they currently aren't, and we save
@ -424,6 +425,7 @@ pub unsafe extern fn raise(exception: *const Exception) -> ! {
}
#[export_name="__artiq_reraise"]
#[unwind]
pub unsafe extern fn reraise() -> ! {
if INFLIGHT.handled {
raise(&INFLIGHT.exception.unwrap())

View File

@ -1,4 +1,4 @@
#![feature(lang_items, asm, libc, panic_unwind)]
#![feature(lang_items, asm, libc, panic_unwind, unwind_attributes)]
#![no_std]
extern crate alloc_none;

View File

@ -1,4 +1,4 @@
#![feature(libc, panic_unwind)]
#![feature(libc, panic_unwind, unwind_attributes)]
#![crate_name = "artiq_support"]
#![crate_type = "cdylib"]