From b0292c766fe68482648023881639266f696fe472 Mon Sep 17 00:00:00 2001 From: Henry Gressmann Date: Thu, 7 Dec 2023 01:18:06 +0100 Subject: feat: improve lable/block handling, add support for more arithmetic opcodes Signed-off-by: Henry Gressmann --- crates/types/src/instructions.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crates/types') diff --git a/crates/types/src/instructions.rs b/crates/types/src/instructions.rs index 40bb9f4..005da36 100644 --- a/crates/types/src/instructions.rs +++ b/crates/types/src/instructions.rs @@ -14,6 +14,9 @@ pub struct MemArg { pub offset: u64, } +type BrTableDefault = u32; +type BrTableLen = usize; + /// A WebAssembly Instruction /// See https://webassembly.github.io/spec/core/binary/instructions.html /// These are our own internal bytecode instructions so they may not match the spec exactly. @@ -35,7 +38,7 @@ pub enum Instruction { End, Br(LabelAddr), BrIf(LabelAddr), - BrTable(u32, u32), // has to be followed by multiple BrLabel instructions + BrTable(BrTableDefault, BrTableLen), // has to be followed by multiple BrLabel instructions Return, Call(FuncAddr), CallIndirect(TypeAddr, TableAddr), -- cgit v1.3.1