nesdie
nesdie copied to clipboard
Panic handler does not work
These code does not work
if let Some(s) = info.payload().downcast_ref::<&str>() {
env::panic_str(s);
} else {
env::panic_str("unexpected panic occurred");
}
Always execute else branch when custom panic happen.
#[no_mangle]
pub extern "C" fn test() {
None.expect("Custom panic message"); // We can not get this message
}
Hacktober