Skip to content

Commit 46c1ac5

Browse files
committed
Update wasi-stub dependencies
Signed-off-by: Tin Švagelj <[email protected]>
1 parent 03086a8 commit 46c1ac5

File tree

3 files changed

+121
-28
lines changed

3 files changed

+121
-28
lines changed

Cargo.lock

+112-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/wasi-stub/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ authors = ["Arnaud Golfouse <[email protected]>"]
66
repository = "https://github.com/astrale-sharp/wasm-minimal-protocol"
77

88
[dependencies]
9-
wast = "65.0"
10-
wasmprinter = "0.2"
9+
wast = "219.0"
10+
wasmprinter = "0.219"

crates/wasi-stub/src/lib.rs

+7-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::collections::{HashMap, HashSet};
33
use wast::{
44
core::{
55
Expression, Func, FuncKind, FunctionType, HeapType, InlineExport, Instruction, ItemKind,
6-
Local, ModuleField, ModuleKind, RefType, TypeUse, ValType,
6+
Local, ModuleField, ModuleKind, RefType, TypeUse, ValType, InnerTypeKind,
77
},
88
token::{Id, Index, NameAnnotation},
99
Wat,
@@ -114,7 +114,7 @@ pub fn stub_wasi_functions(
114114
println!("Stubbing function {}::{}", i.module, i.field);
115115
let typ = &types[type_index];
116116
let ty = TypeUse::new_with_index(Index::Num(type_index as u32, typ.span));
117-
let wast::core::TypeDef::Func(func_typ) = &typ.def else {
117+
let wast::core::TypeDef{kind: InnerTypeKind::Func(func_typ), ..} = &typ.def else {
118118
continue;
119119
};
120120
let id = static_id(i.item.id);
@@ -136,24 +136,15 @@ pub fn stub_wasi_functions(
136136
ValType::Ref(r) => ValType::Ref(RefType {
137137
nullable: r.nullable,
138138
heap: match r.heap {
139-
HeapType::Func => HeapType::Func,
140-
HeapType::Extern => HeapType::Extern,
141-
HeapType::Any => HeapType::Any,
142-
HeapType::Eq => HeapType::Eq,
143-
HeapType::Struct => HeapType::Struct,
144-
HeapType::Array => HeapType::Array,
145-
HeapType::I31 => HeapType::I31,
146-
HeapType::NoFunc => HeapType::NoFunc,
147-
HeapType::NoExtern => HeapType::NoExtern,
148-
HeapType::None => HeapType::None,
149-
HeapType::Index(index) => {
150-
HeapType::Index(match index {
139+
HeapType::Concrete(index) => {
140+
HeapType::Concrete(match index {
151141
Index::Num(n, s) => Index::Num(n, s),
152142
Index::Id(id) => {
153143
Index::Id(static_id(Some(id)).unwrap())
154144
}
155145
})
156146
}
147+
HeapType::Abstract { shared, ty } => HeapType::Abstract { shared, ty },
157148
},
158149
}),
159150
},
@@ -253,6 +244,8 @@ pub fn stub_wasi_functions(
253244
locals: locals.into_boxed_slice(),
254245
expression: Expression {
255246
instrs: instructions.into_boxed_slice(),
247+
branch_hints: Box::new([]),
248+
instr_spans: None,
256249
},
257250
},
258251
ty,

0 commit comments

Comments
 (0)