From ef4dbf261d13a72931887dad8db02d53a695a810 Mon Sep 17 00:00:00 2001 From: Henry Gressmann Date: Tue, 5 Dec 2023 23:45:45 +0100 Subject: feat: block stack, make cargofmt a bit more sane Signed-off-by: Henry Gressmann --- crates/types/src/instructions.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'crates/types') diff --git a/crates/types/src/instructions.rs b/crates/types/src/instructions.rs index 13f8ce0..40bb9f4 100644 --- a/crates/types/src/instructions.rs +++ b/crates/types/src/instructions.rs @@ -4,8 +4,7 @@ use super::{FuncAddr, GlobalAddr, LabelAddr, LocalAddr, TableAddr, TypeAddr, Val pub enum BlockArgs { Empty, Type(ValType), - // TODO: wasm 2.0 - // FuncType(u32), + FuncType(u32), } /// Represents a memory immediate in a WebAssembly memory instruction. @@ -22,6 +21,9 @@ pub struct MemArg { /// For example, `br_table` stores the jump lables in the following `br_label` instructions to keep this enum small. #[derive(Debug, Clone, Copy, PartialEq)] pub enum Instruction { + // Custom Instructions + BrLabel(LabelAddr), + // Control Instructions // See https://webassembly.github.io/spec/core/binary/instructions.html#control-instructions Unreachable, @@ -33,8 +35,7 @@ pub enum Instruction { End, Br(LabelAddr), BrIf(LabelAddr), - BrTable(u32), // has to be followed by multiple BrLabel instructions - BrLabel(LabelAddr), + BrTable(u32, u32), // has to be followed by multiple BrLabel instructions Return, Call(FuncAddr), CallIndirect(TypeAddr, TableAddr), -- cgit v1.3.1