Skip to content

Commit

Permalink
chore: remove some wasm2 types for now
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Gressmann <[email protected]>
  • Loading branch information
explodingcamera committed Dec 5, 2023
1 parent 67adf21 commit 7d2a0a7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion crates/parser/src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,16 @@ pub(crate) fn convert_blocktype(blocktype: &wasmparser::BlockType) -> BlockArgs
use wasmparser::BlockType::*;
match blocktype {
Empty => BlockArgs::Empty,

// We should maybe have all this in a single variant for our custom bytecode

// TODO: maybe solve this differently so we can support 128-bit values
// without having to increase the size of the WasmValue enum
Type(ty) => BlockArgs::Type(convert_valtype(ty)),
FuncType(ty) => BlockArgs::FuncType(*ty),

// Wasm 2.0
FuncType(_ty) => unimplemented!(),
// FuncType(ty) => BlockArgs::FuncType(*ty),
}
}

Expand Down
3 changes: 2 additions & 1 deletion crates/types/src/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ use super::{FuncAddr, GlobalAddr, LabelAddr, LocalAddr, TableAddr, TypeAddr, Val
pub enum BlockArgs {
Empty,
Type(ValType),
FuncType(u32),
// TODO: wasm 2.0
// FuncType(u32),
}

/// Represents a memory immediate in a WebAssembly memory instruction.
Expand Down

0 comments on commit 7d2a0a7

Please sign in to comment.