wasm_interp: use Value::from in more places

This commit is contained in:
Brian Carroll 2022-11-27 20:57:50 +00:00
parent 78fbc75249
commit 8e15d49720
No known key found for this signature in database
GPG key ID: 5C7B2EC4101703C0
2 changed files with 30 additions and 29 deletions

View file

@ -733,6 +733,18 @@ impl From<u64> for Value {
}
}
impl From<i32> for Value {
fn from(x: i32) -> Self {
Value::I32(x)
}
}
impl From<i64> for Value {
fn from(x: i64) -> Self {
Value::I64(x)
}
}
/// Wasm memory alignment for load/store instructions.
/// Rust representation matches Wasm encoding.
/// It's an error to specify alignment higher than the "natural" alignment of the instruction