Skip to content

Commit

Permalink
deps: wasmprinter update
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Jan 31, 2024
1 parent a2ce442 commit e10b18f
Show file tree
Hide file tree
Showing 18 changed files with 23 additions and 24 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ leb128 = "0.2.4"
log = "0.4.8"
rayon = { version = "1.1.0", optional = true }
walrus-macro = { path = './crates/macro', version = '=0.19.0' }
wasm-encoder = "0.29.0"
wasm-encoder = "0.41.0"
wasmparser = "0.80.2"
gimli = "0.26.0"

Expand Down
2 changes: 1 addition & 1 deletion crates/fuzz-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ anyhow = "1.0"
env_logger = "0.8.1"
rand = { version = "0.7.0", features = ['small_rng'] }
tempfile = "3.1.0"
wasmparser = "0.67"
wasmparser = "0.80.2"
wat = "1.0"

[dependencies.walrus]
Expand Down
4 changes: 2 additions & 2 deletions crates/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ serde_json = { version = "1.0.40", features = ['preserve_order'] }
tempfile = "3.1.0"
walrus = { path = "../.." }
walrus-tests-utils = { path = "../tests-utils" }
wasmprinter = "=0.2.59"
wat = "1.0.36"
wasmprinter = "=0.2.78"
wat = "1.0.85"

[features]
parallel = ['walrus/parallel']
Expand Down
2 changes: 1 addition & 1 deletion crates/tests/tests/round_trip/elem-segments-1.wat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(module
(table 1 anyfunc)
(table 1 funcref)
(func)
(elem (i32.const 1) 0)
(export "foo" (table 0))
Expand Down
2 changes: 1 addition & 1 deletion crates/tests/tests/round_trip/elem-segments-2.wat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(module
(table 1 anyfunc)
(table 1 funcref)
(func)
(elem (i32.const 1) 0)
(elem (i32.const 2) 0)
Expand Down
2 changes: 1 addition & 1 deletion crates/tests/tests/round_trip/elem-segments-3.wat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(module
(table 1 anyfunc)
(table 1 funcref)
(func)
(elem (i32.const 1) 0)
(elem (i32.const 3) 0)
Expand Down
2 changes: 1 addition & 1 deletion crates/tests/tests/round_trip/gc_keep_used_tables.wat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

(module
(type (;0;) (func (result i32)))
(table 1 1 anyfunc)
(table 1 1 funcref)
(export "t" (table 0)))

(; CHECK-ALL:
Expand Down
2 changes: 1 addition & 1 deletion crates/tests/tests/round_trip/gc_unused_tables.wat
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

(module
(type (;0;) (func (result i32)))
(table 1 1 anyfunc)
(table 1 1 funcref)
(func $f (type 0) (result i32)
i32.const 42)
(export "f" (func $f)))
Expand Down
2 changes: 1 addition & 1 deletion crates/tests/tests/round_trip/import-gc.wat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(module
(type (func))
(import "" "a" (func (type 0)))
(import "" "b" (table 1 anyfunc))
(import "" "b" (table 1 funcref))
(import "" "c" (global i32))
(import "" "d" (memory 1))
)
Expand Down
2 changes: 1 addition & 1 deletion crates/tests/tests/round_trip/import-table.wat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(module
(import "" "" (table 1 anyfunc))
(import "" "" (table 1 funcref))
(export "b" (table 0))
)

Expand Down
2 changes: 1 addition & 1 deletion crates/tests/tests/round_trip/keep-elem-segments.wat
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(module
(type (func))

(table anyfunc (elem 1))
(table funcref (elem 1))

(func
i32.const 0
Expand Down
2 changes: 1 addition & 1 deletion crates/tests/tests/round_trip/table-init.wast
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(module
(import "x" "y" (global i32))
(table 1 anyfunc)
(table 1 funcref)
(func)
(elem (global.get 0) 0)
(export "x" (table 0)))
Expand Down
2 changes: 1 addition & 1 deletion crates/tests/tests/valid/const.wat
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
(type (;0;) (func (result i32)))
(func $inc (type 0) (result i32)
i32.const 42)
(table (;0;) 1 1 anyfunc)
(table (;0;) 1 1 funcref)
(memory (;0;) 16))
2 changes: 1 addition & 1 deletion crates/tests/tests/valid/inc.wat
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
local.get 0
i32.const 1
i32.add)
(table (;0;) 1 1 anyfunc)
(table (;0;) 1 1 funcref)
(memory (;0;) 16))
1 change: 0 additions & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! Error types and utilities.

pub use anyhow::Error;
use std::fmt;

/// Either `Ok(T)` or `Err(failure::Error)`.
Expand Down
4 changes: 1 addition & 3 deletions src/module/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ pub trait CustomSection: WalrusAny + Debug + Send + Sync {
/// array provided.
///
/// The default provided method does nothing.
fn add_gc_roots(&self, roots: &mut Roots) {
drop(roots);
}
fn add_gc_roots(&self, _roots: &mut Roots) {}

/// Apply the given code transformations to this custom section.
///
Expand Down
10 changes: 6 additions & 4 deletions src/module/elements.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ impl Emit for ModuleElements {
None => wasm_encoder::ConstExpr::ref_null(wasm_encoder::HeapType::Func),
})
.collect();
let els = wasm_encoder::Elements::Expressions(els_vec.as_slice());
let els = wasm_encoder::Elements::Expressions(
wasm_encoder::RefType::FUNCREF,
els_vec.as_slice(),
);
emit_elem(cx, &mut wasm_element_section, &element.kind, els);
} else {
let els_vec: Vec<u32> = element
Expand All @@ -212,15 +215,14 @@ impl Emit for ModuleElements {
wasm_element_section.active(
table_index,
&offset.to_wasmencoder_type(&cx),
wasm_encoder::RefType::FUNCREF,
els,
);
}
ElementKind::Passive => {
wasm_element_section.passive(wasm_encoder::RefType::FUNCREF, els);
wasm_element_section.passive(els);
}
ElementKind::Declared => {
wasm_element_section.declared(wasm_encoder::RefType::FUNCREF, els);
wasm_element_section.declared(els);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/module/exports.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Exported items in a wasm module.

use anyhow::{bail, Context};
use anyhow::Context;

use crate::emit::{Emit, EmitContext};
use crate::parse::IndicesToIds;
Expand Down

0 comments on commit e10b18f

Please sign in to comment.