wasm_interp: pass arguments from CLI

This commit is contained in:
Brian Carroll 2022-11-26 08:48:36 +00:00
parent fa1e0a8614
commit a09fd95fd7
No known key found for this signature in database
GPG key ID: 5C7B2EC4101703C0
6 changed files with 92 additions and 36 deletions

View file

@ -659,6 +659,17 @@ impl From<u8> for ValueType {
}
}
impl From<Value> for ValueType {
fn from(x: Value) -> Self {
match x {
Value::I32(_) => Self::I32,
Value::I64(_) => Self::I64,
Value::F32(_) => Self::F32,
Value::F64(_) => Self::F64,
}
}
}
impl Parse<()> for ValueType {
fn parse(_: (), bytes: &[u8], cursor: &mut usize) -> Result<Self, ParseError> {
let byte = u8::parse((), bytes, cursor)?;