diff options
| author | Henry Gressmann <mail@henrygressmann.de> | 2023-12-07 01:18:06 +0100 |
|---|---|---|
| committer | Henry Gressmann <mail@henrygressmann.de> | 2023-12-07 01:18:06 +0100 |
| commit | b0292c766fe68482648023881639266f696fe472 (patch) | |
| tree | 5004ea717a16a23f37c87d0467021879ddc0b6d9 /crates/types | |
| parent | 0cf77f7347d551437baff6bfb7c5768930c50198 (diff) | |
feat: improve lable/block handling, add support for more arithmetic opcodes
Signed-off-by: Henry Gressmann <mail@henrygressmann.de>
Diffstat (limited to 'crates/types')
| -rw-r--r-- | crates/types/src/instructions.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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), |
