Skip to content

Commit

Permalink
chore: updates for latest wasm-encoder changes (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
zshipko authored Jun 25, 2024
1 parent 30d68d8 commit cf5122f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "A library to help generate WebAssembly"

[dependencies]
anyhow = "1.0.71"
wasm-encoder = {version = "0.209.0", features = ["wasmparser"]}
wasm-encoder = {version = "0.211.1", features = ["wasmparser"]}
wasmparser = {version = "0.211.1"}
extism-manifest = {version = "1", optional = true}
extism = {version = "1", optional = true}
Expand Down
25 changes: 20 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,14 +471,20 @@ impl<'a> Module<'a> {
pub fn any_type(nullable: bool) -> ValType {
ValType::Ref(RefType {
nullable,
heap_type: HeapType::Any,
heap_type: HeapType::Abstract {
shared: false,
ty: encoder::AbstractHeapType::Any,
},
})
}

pub fn none_type(nullable: bool) -> ValType {
ValType::Ref(RefType {
nullable,
heap_type: HeapType::None,
heap_type: HeapType::Abstract {
shared: false,
ty: encoder::AbstractHeapType::None,
},
})
}

Expand All @@ -492,21 +498,30 @@ pub fn i31_type(nullable: bool) -> ValType {
pub fn eq_type(nullable: bool) -> ValType {
ValType::Ref(RefType {
nullable,
heap_type: HeapType::Eq,
heap_type: HeapType::Abstract {
shared: false,
ty: encoder::AbstractHeapType::Eq,
},
})
}

pub fn func_type(nullable: bool) -> ValType {
ValType::Ref(RefType {
nullable,
heap_type: HeapType::Func,
heap_type: HeapType::Abstract {
shared: false,
ty: encoder::AbstractHeapType::Func,
},
})
}

pub fn extern_type(nullable: bool) -> ValType {
ValType::Ref(RefType {
nullable,
heap_type: HeapType::Extern,
heap_type: HeapType::Abstract {
shared: false,
ty: encoder::AbstractHeapType::Extern,
},
})
}

Expand Down

0 comments on commit cf5122f

Please sign in to comment.