diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2024-01-08 16:20:58 +0100 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2024-01-08 16:20:58 +0100 |
| commit | 8077653ddf3d4c555bc90d1647f4a3e9eed576a5 (patch) | |
| tree | 0534fe79ce14f6cf90eff17f375bb330b297ef06 /crates/types/src | |
| parent | 8d6e1e14c4f73e9793b7f7b15cf801a332f8aa5c (diff) | |
feat: br_table
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/types/src')
| -rw-r--r-- | crates/types/src/lib.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/types/src/lib.rs b/crates/types/src/lib.rs index 1213515..d3bf81a 100644 --- a/crates/types/src/lib.rs +++ b/crates/types/src/lib.rs @@ -88,6 +88,9 @@ pub enum WasmValue { F64(f64), // Vec types // V128(i128), + // RefExtern(ExternAddr), + // RefHost(FuncAddr), + RefNull(ValType), } impl WasmValue { @@ -97,6 +100,9 @@ impl WasmValue { Self::I64(i) => ConstInstruction::I64Const(*i), Self::F32(i) => ConstInstruction::F32Const(*i), Self::F64(i) => ConstInstruction::F64Const(*i), + Self::RefNull(ty) => ConstInstruction::RefNull(*ty), + // Self::RefExtern(addr) => ConstInstruction::RefExtern(*addr), + // _ => unimplemented!("const_instr for {:?}", self), } } @@ -217,6 +223,7 @@ impl Debug for WasmValue { WasmValue::I64(i) => write!(f, "i64({})", i), WasmValue::F32(i) => write!(f, "f32({})", i), WasmValue::F64(i) => write!(f, "f64({})", i), + WasmValue::RefNull(ty) => write!(f, "ref.null({:?})", ty), // WasmValue::V128(i) => write!(f, "v128({})", i), } } @@ -230,6 +237,7 @@ impl WasmValue { Self::I64(_) => ValType::I64, Self::F32(_) => ValType::F32, Self::F64(_) => ValType::F64, + Self::RefNull(ty) => *ty, // Self::V128(_) => ValType::V128, } } |
