standlone: Implement __nac3_raise for demo

This commit is contained in:
David Mak 2023-09-15 12:08:30 +08:00
parent bfda888bbf
commit 3b780b573d
1 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,7 @@
use std::io;
use std::io::Write;
use std::process::exit;
mod cslice {
// copied from https://github.com/dherman/cslice
use std::marker::PhantomData;
@ -76,7 +80,13 @@ pub extern "C" fn __nac3_personality(_state: u32, _exception_object: u32, _conte
#[no_mangle]
pub extern "C" fn __nac3_raise(_state: u32, _exception_object: u32, _context: u32) -> u32 {
unimplemented!();
writeln!(io::stderr(),
"__nac3_raise(state: {:#010x}, _exception_object: {:#010x}, _context: {:#010x})",
_state,
_exception_object,
_context
).unwrap();
exit(101);
}
extern "C" {