mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-23 21:51:32 +00:00
Improve panic/unreachable/unimplemented usage. Refactor a little.
This commit is contained in:
@ -618,7 +618,7 @@ fn call_func_with_index(
|
||||
Type::I64 => Value::I64(raw as i64),
|
||||
Type::F32 => Value::F32(f32::from_bits(raw as u32)),
|
||||
Type::F64 => Value::F64(f64::from_bits(raw)),
|
||||
_ => unreachable!(),
|
||||
Type::V128 => unreachable!("V128 does not map to any single value"),
|
||||
};
|
||||
|
||||
match signature.returns() {
|
||||
|
@ -83,9 +83,10 @@ impl Instance for LocalInstance {
|
||||
match args_u64.len() {
|
||||
0 => (transmute::<_, extern "C" fn() -> u128>(addr))(),
|
||||
1 => (transmute::<_, extern "C" fn(u64) -> u128>(addr))(args_u64[0]),
|
||||
2 => {
|
||||
(transmute::<_, extern "C" fn(u64, u64) -> u128>(addr))(args_u64[0], args_u64[1])
|
||||
}
|
||||
2 => (transmute::<_, extern "C" fn(u64, u64) -> u128>(addr))(
|
||||
args_u64[0],
|
||||
args_u64[1],
|
||||
),
|
||||
3 => (transmute::<_, extern "C" fn(u64, u64, u64) -> u128>(addr))(
|
||||
args_u64[0],
|
||||
args_u64[1],
|
||||
|
Reference in New Issue
Block a user