mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-22 13:11:32 +00:00
Fixed formatting and removed print debug statement
This commit is contained in:
@ -41,7 +41,11 @@ pub struct HandlerData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl HandlerData {
|
impl HandlerData {
|
||||||
pub fn new(trap_data: TrapSink, exec_buffer_ptr: *const c_void, exec_buffer_size: usize) -> Self {
|
pub fn new(
|
||||||
|
trap_data: TrapSink,
|
||||||
|
exec_buffer_ptr: *const c_void,
|
||||||
|
exec_buffer_size: usize,
|
||||||
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
trap_data,
|
trap_data,
|
||||||
exec_buffer_ptr,
|
exec_buffer_ptr,
|
||||||
@ -89,12 +93,10 @@ pub fn call_protected<T>(handler_data: &HandlerData, f: impl FnOnce() -> T) -> R
|
|||||||
TrapCode::IndirectCallToNull => RuntimeError::IndirectCallToNull {
|
TrapCode::IndirectCallToNull => RuntimeError::IndirectCallToNull {
|
||||||
table: TableIndex::new(0),
|
table: TableIndex::new(0),
|
||||||
},
|
},
|
||||||
TrapCode::HeapOutOfBounds => {
|
TrapCode::HeapOutOfBounds => RuntimeError::OutOfBoundsAccess {
|
||||||
RuntimeError::OutOfBoundsAccess {
|
memory: MemoryIndex::new(0),
|
||||||
memory: MemoryIndex::new(0),
|
addr: 0,
|
||||||
addr: 0,
|
},
|
||||||
}
|
|
||||||
}
|
|
||||||
TrapCode::TableOutOfBounds => RuntimeError::TableOutOfBounds {
|
TrapCode::TableOutOfBounds => RuntimeError::TableOutOfBounds {
|
||||||
table: TableIndex::new(0),
|
table: TableIndex::new(0),
|
||||||
},
|
},
|
||||||
@ -102,12 +104,10 @@ pub fn call_protected<T>(handler_data: &HandlerData, f: impl FnOnce() -> T) -> R
|
|||||||
msg: "unknown trap".to_string(),
|
msg: "unknown trap".to_string(),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Ok(SIGSEGV) | Ok(SIGBUS) => {
|
Ok(SIGSEGV) | Ok(SIGBUS) => RuntimeError::OutOfBoundsAccess {
|
||||||
RuntimeError::OutOfBoundsAccess {
|
memory: MemoryIndex::new(0),
|
||||||
memory: MemoryIndex::new(0),
|
addr: 0,
|
||||||
addr: 0,
|
},
|
||||||
}
|
|
||||||
}
|
|
||||||
Ok(SIGFPE) => RuntimeError::IllegalArithmeticOperation,
|
Ok(SIGFPE) => RuntimeError::IllegalArithmeticOperation,
|
||||||
_ => unimplemented!(),
|
_ => unimplemented!(),
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ pub fn run_emscripten_instance(
|
|||||||
instance.call("___emscripten_environ_constructor", &[])?;
|
instance.call("___emscripten_environ_constructor", &[])?;
|
||||||
}
|
}
|
||||||
|
|
||||||
println!("running emscripten instance");
|
// println!("running emscripten instance");
|
||||||
|
|
||||||
let main_func = instance.dyn_func("_main")?;
|
let main_func = instance.dyn_func("_main")?;
|
||||||
let num_params = main_func.signature().params().len();
|
let num_params = main_func.signature().params().len();
|
||||||
|
Reference in New Issue
Block a user