Skip to content

Commit c53fd69

Browse files
committed
chore: Update wasmencoder to v0.10.0
This update will make it easier to keep track of the index space of each section while constructing modules by relying on the provided `len` method of each section rather than having to maintain internal data structure for this purpose.
1 parent d5c8b39 commit c53fd69

File tree

6 files changed

+130
-132
lines changed

6 files changed

+130
-132
lines changed

Cargo.lock

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/wasmlink/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ anyhow = "1.0.40"
99
heck = "0.3.3"
1010
lazy_static = "1.4.0"
1111
petgraph = "0.5.1"
12-
wasm-encoder = "0.4.1"
12+
wasm-encoder = "0.10.0"
1313
wasmparser = "0.78.1"
1414
wit-parser = { path = "../parser" }
1515

crates/wasmlink/src/adapter.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,16 @@ impl<'a> ModuleAdapter<'a> {
142142
let mut func = wasm_encoder::Function::new(std::iter::empty());
143143

144144
for i in 0..info.import_type.params.len() as u32 {
145-
func.instruction(wasm_encoder::Instruction::LocalGet(i));
145+
func.instruction(&wasm_encoder::Instruction::LocalGet(i));
146146
}
147147

148-
func.instruction(wasm_encoder::Instruction::I32Const(func_index as i32));
149-
func.instruction(wasm_encoder::Instruction::CallIndirect {
148+
func.instruction(&wasm_encoder::Instruction::I32Const(func_index as i32));
149+
func.instruction(&wasm_encoder::Instruction::CallIndirect {
150150
ty: *type_index,
151151
table: 0,
152152
});
153153

154-
func.instruction(wasm_encoder::Instruction::End);
154+
func.instruction(&wasm_encoder::Instruction::End);
155155

156156
code.function(&func);
157157
}
@@ -170,10 +170,8 @@ impl<'a> ModuleAdapter<'a> {
170170

171171
tables.table(wasm_encoder::TableType {
172172
element_type: wasm_encoder::ValType::FuncRef,
173-
limits: wasm_encoder::Limits {
174-
min: table_len,
175-
max: Some(table_len),
176-
},
173+
minimum: table_len,
174+
maximum: Some(table_len),
177175
});
178176

179177
exports.export(FUNCTION_TABLE_NAME, wasm_encoder::Export::Table(0));
@@ -300,7 +298,9 @@ impl<'a> ModuleAdapter<'a> {
300298
PARENT_MODULE_NAME,
301299
Some(MEMORY_EXPORT_NAME),
302300
wasm_encoder::EntityType::Memory(wasm_encoder::MemoryType {
303-
limits: wasm_encoder::Limits { min: 0, max: None },
301+
maximum: None,
302+
minimum: 0,
303+
memory64: false,
304304
}),
305305
);
306306

0 commit comments

Comments
 (0)