Fix abort and _abort to be different

This commit is contained in:
Mark McCaskey
2019-12-02 15:32:14 -08:00
parent cd946f1d27
commit e8b162df06
3 changed files with 11 additions and 7 deletions

View File

@ -10,14 +10,18 @@ use wasmer_runtime_core::vm::Ctx;
pub fn abort_with_message(ctx: &mut Ctx, message: &str) {
debug!("emscripten::abort_with_message");
println!("{}", message);
_abort(ctx, 0);
_abort(ctx);
}
pub fn _abort(_ctx: &mut Ctx, arg: u32) {
/// The name of this call is `abort` but we want to avoid conflicts with libc::abort
pub fn em_abort(ctx: &mut Ctx, arg: u32) {
debug!("emscripten::abort");
eprintln!("Program aborted with value {}", arg);
_abort(ctx);
}
pub fn _abort(_ctx: &mut Ctx) {
debug!("emscripten::_abort");
if arg != 0 {
eprintln!("Program aborted with value {}", arg);
}
unsafe {
abort();
}