mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-24 06:01:33 +00:00
Improve panic/unreachable/unimplemented usage. Refactor a little.
This commit is contained in:
@ -402,7 +402,7 @@ pub unsafe extern "C" fn wasmer_export_func_call(
|
||||
tag: wasmer_value_tag::WASM_F64,
|
||||
value: wasmer_value { F64: x },
|
||||
},
|
||||
_ => panic!("not implemented"),
|
||||
Value::V128(_) => unimplemented!("returning V128 type"),
|
||||
};
|
||||
results[0] = ret;
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ pub unsafe extern "C" fn wasmer_instance_call(
|
||||
tag: wasmer_value_tag::WASM_F64,
|
||||
value: wasmer_value { F64: x },
|
||||
},
|
||||
_ => panic!("not implemented"),
|
||||
Value::V128(_) => unimplemented!("calling function with V128 parameter"),
|
||||
};
|
||||
results[0] = ret;
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ impl From<wasmer_value_t> for Value {
|
||||
tag: wasmer_value_tag::WASM_F64,
|
||||
value: wasmer_value { F64 },
|
||||
} => Value::F64(F64),
|
||||
_ => panic!("not implemented"),
|
||||
_ => unreachable!("unknown WASM type"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -76,7 +76,7 @@ impl From<Value> for wasmer_value_t {
|
||||
tag: wasmer_value_tag::WASM_F64,
|
||||
value: wasmer_value { F64: x },
|
||||
},
|
||||
_ => panic!("not implemented"),
|
||||
Value::V128(_) => unimplemented!("V128 not supported in C API"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -89,7 +89,7 @@ impl From<Type> for wasmer_value_tag {
|
||||
Type::I64 => wasmer_value_tag::WASM_I64,
|
||||
Type::F32 => wasmer_value_tag::WASM_F32,
|
||||
Type::F64 => wasmer_value_tag::WASM_F64,
|
||||
_ => panic!("not implemented"),
|
||||
Type::V128 => unreachable!("V128 not supported in C API"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -102,7 +102,7 @@ impl From<wasmer_value_tag> for Type {
|
||||
wasmer_value_tag::WASM_I64 => Type::I64,
|
||||
wasmer_value_tag::WASM_F32 => Type::F32,
|
||||
wasmer_value_tag::WASM_F64 => Type::F64,
|
||||
_ => panic!("not implemented"),
|
||||
_ => unreachable!("unknown WASM type"),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -114,7 +114,7 @@ impl From<&wasmer_runtime::wasm::Type> for wasmer_value_tag {
|
||||
Type::I64 => wasmer_value_tag::WASM_I64,
|
||||
Type::F32 => wasmer_value_tag::WASM_F32,
|
||||
Type::F64 => wasmer_value_tag::WASM_F64,
|
||||
_ => panic!("not implemented"),
|
||||
Type::V128 => unimplemented!("V128 not supported in C API"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user