Skip to content

Commit 4159cb3

Browse files
committed
add aborts
1 parent 910a64d commit 4159cb3

File tree

1 file changed

+3
-9
lines changed
  • sdk/pinocchio/src/entrypoint

1 file changed

+3
-9
lines changed

sdk/pinocchio/src/entrypoint/mod.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,9 @@ macro_rules! default_panic_handler {
233233
/// Default panic handler.
234234
#[cfg(all(not(feature = "custom-panic"), target_os = "solana"))]
235235
#[no_mangle]
236-
#[panic_handler]
237-
fn custom_panic(info: &core::panic::PanicInfo<'_>) -> ! {
236+
fn custom_panic(info: &core::panic::PanicInfo<'_>) {
238237
// Panic reporting.
239238
$crate::msg!("{}", info);
240-
unsafe {
241-
core::hint::unreachable_unchecked();
242-
}
243239
}
244240
};
245241
}
@@ -257,15 +253,13 @@ macro_rules! default_panic_handler {
257253
#[cfg(all(not(feature = "custom-panic"), target_os = "solana"))]
258254
#[no_mangle]
259255
#[panic_handler]
260-
fn custom_panic(info: &core::panic::PanicInfo<'_>) -> ! {
256+
fn handler(info: &core::panic::PanicInfo<'_>) -> ! {
261257
if let Some(location) = info.location() {
262258
$crate::log::sol_log(location.file());
263259
}
264260
// Panic reporting.
265261
$crate::log::sol_log("** PANICKED **");
266-
unsafe {
267-
core::hint::unreachable_unchecked();
268-
}
262+
unsafe { $crate::syscalls::abort() }
269263
}
270264
};
271265
}

0 commit comments

Comments
 (0)