2018-12-18 12:44:15 +00:00
|
|
|
use super::process::_abort;
|
2019-01-03 02:50:13 +00:00
|
|
|
use crate::apis::emscripten::env;
|
2018-12-18 17:43:59 +00:00
|
|
|
use crate::webassembly::Instance;
|
2018-12-13 18:28:30 +00:00
|
|
|
|
|
|
|
/// emscripten: ___cxa_allocate_exception
|
|
|
|
pub extern "C" fn ___cxa_allocate_exception(size: u32, instance: &mut Instance) -> u32 {
|
|
|
|
debug!("emscripten::___cxa_allocate_exception");
|
2019-01-03 02:50:13 +00:00
|
|
|
env::call_malloc(size as _, instance)
|
2018-12-13 18:28:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/// emscripten: ___cxa_throw
|
|
|
|
/// TODO: We don't have support for exceptions yet
|
|
|
|
pub extern "C" fn ___cxa_throw(ptr: u32, ty: u32, destructor: u32, instance: &mut Instance) {
|
|
|
|
debug!("emscripten::___cxa_throw");
|
2018-12-18 12:44:15 +00:00
|
|
|
_abort();
|
2018-12-13 18:28:30 +00:00
|
|
|
}
|