Skip to content

Commit

Permalink
Don't ask for aborting panics, make sure they're used
Browse files Browse the repository at this point in the history
  • Loading branch information
HadrienG2 committed Oct 30, 2018
1 parent efacc77 commit 58a623a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ members = [
"uefi-services",
"uefi-exts",
]

[profile.debug]
panic = "abort"

[profile.release]
panic = "abort"
5 changes: 1 addition & 4 deletions src/table/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,6 @@ impl BootServices {
/// priority level. If the event type has flag NotifyWait, the notification
/// will be delivered next time `wait_for_event` or `check_event` is called.
/// In both cases, a `notify_fn` callback must be specified.
///
/// Note that the safety of this function relies on aborting panics being
/// used, as requested by the uefi-rs documentation.
pub fn create_event(
&self,
event_ty: EventType,
Expand All @@ -242,7 +239,7 @@ impl BootServices {
// Use a trampoline to handle the impedance mismatch between Rust & C
unsafe extern "win64" fn notify_trampoline(e: Event, ctx: *mut c_void) {
let notify_fn: fn(Event) = core::mem::transmute(ctx);
notify_fn(e); // Aborting panics are assumed here
notify_fn(e); // SAFETY: Aborting panics are assumed here
}
let (notify_func, notify_ctx) = notify_fn
.map(|notify_fn| {
Expand Down

0 comments on commit 58a623a

Please sign in to comment.