Skip to content

Commit

Permalink
Bug 1823476 - Update wast vendor dependency. r=supply-chain-reviewers
Browse files Browse the repository at this point in the history
Updated wast=55.0.0.

And also wasm-smith to avoid duplicate copy of wasm-encoder.

Differential Revision: https://phabricator.services.mozilla.com/D173217
  • Loading branch information
yurydelendik committed Mar 22, 2023
1 parent 64062e1 commit d7a441b
Show file tree
Hide file tree
Showing 47 changed files with 1,538 additions and 598 deletions.
16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/src/fuzz-tests/gluesmith/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ authors = ["Christian Holler"]
license = "MPL-2.0"

[dependencies]
wasm-smith = "0.12.2"
wasm-smith = "0.12.5"
arbitrary = { version = "1.0.0", features = ["derive"] }
libc = "0.2"
2 changes: 1 addition & 1 deletion js/src/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ gluesmith = ['jsrust_shared/gluesmith']
jsrust_shared = { path = "./shared" }
# Workaround for https://github.com/rust-lang/rust/issues/58393
mozglue-static = { path = "../../../mozglue/static/rust" }
wast = { version = "53.0.0" }
wast = { version = "55.0.0" }
24 changes: 24 additions & 0 deletions supply-chain/imports.lock
Original file line number Diff line number Diff line change
Expand Up @@ -197,24 +197,48 @@ criteria = "safe-to-deploy"
version = "0.23.0"
notes = "The Bytecode Alliance is the author of this crate."

[[audits.bytecode-alliance.audits.wasm-encoder]]
who = "Alex Crichton <[email protected]>"
criteria = "safe-to-deploy"
version = "0.25.0"
notes = "The Bytecode Alliance is the author of this crate."

[[audits.bytecode-alliance.audits.wasm-smith]]
who = "Alex Crichton <[email protected]>"
criteria = "safe-to-run"
version = "0.12.2"
notes = "The Bytecode Alliance is the author of this crate."

[[audits.bytecode-alliance.audits.wasm-smith]]
who = "Alex Crichton <[email protected]>"
criteria = "safe-to-run"
version = "0.12.5"
notes = "The Bytecode Alliance is the author of this crate."

[[audits.bytecode-alliance.audits.wasmparser]]
who = "Alex Crichton <[email protected]>"
criteria = "safe-to-deploy"
version = "0.100.0"
notes = "The Bytecode Alliance is the author of this crate."

[[audits.bytecode-alliance.audits.wasmparser]]
who = "Alex Crichton <[email protected]>"
criteria = "safe-to-deploy"
version = "0.102.0"
notes = "The Bytecode Alliance is the author of this crate."

[[audits.bytecode-alliance.audits.wast]]
who = "Alex Crichton <[email protected]>"
criteria = "safe-to-deploy"
version = "53.0.0"
notes = "The Bytecode Alliance is the author of this crate."

[[audits.bytecode-alliance.audits.wast]]
who = "Alex Crichton <[email protected]>"
criteria = "safe-to-deploy"
version = "55.0.0"
notes = "The Bytecode Alliance is the author of this crate."

[[audits.chromeos.audits.fastrand]]
who = "George Burgess IV <[email protected]>"
criteria = "safe-to-deploy"
Expand Down
2 changes: 1 addition & 1 deletion third_party/rust/wasm-encoder/.cargo-checksum.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"files":{"Cargo.toml":"fefb25e72fb204befadd0bedd4b998538a04bdbec2c28d4f70ef725a0de35a17","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"ac016c4843a7e1a5737255b39418732783592222dc518020730edf9dd46a1c13","src/component.rs":"c84b64b732fa84222452e13589ec187d62bee55098ca9e5b299810791b972906","src/component/aliases.rs":"be5215154b872ed5664f3bfe2aa1391f36a2575aa9d53971ab61868a1c446e9d","src/component/canonicals.rs":"8b270caef4e0f1e2b62af5b27560ac370399d11ce411aae6b811dddeaedb7750","src/component/components.rs":"07b8cae3a400e1955cc39d142569910b4fef2136021053d0ddbd6404d810aa52","src/component/exports.rs":"9a685fb44af0cfefbb2e92ddb0259955766cf6d1c0022830a865f92426ce0f7b","src/component/imports.rs":"41414a4cb71d79404e8721a985dd1d3a7df287f6417b4cab017d12e9aef31c43","src/component/instances.rs":"c86f24e466aeb6889413f32d95e039a90a1e20d2e5a0505339aa81fc086a8c24","src/component/modules.rs":"9e80907e72360fae4d8057b6b0e7a6b58edd7ba6aba6e63ba17346518e169617","src/component/names.rs":"7b651284ffdf147aabf1e01226f34ddc8bbe3d38a2dcd26ca0fc15ad24002b6f","src/component/start.rs":"4055553d5c99c99abbc01bb8abb928ecb8b909d148b647a9977fbd444bb464a3","src/component/types.rs":"885e26ce451a50ff48ab472161d8923c0195406180f36588c1d38c79181dee51","src/core.rs":"492e5ce8de8e0c0bfe55fdad62d0b8825ed88b4a01f4e1dcffae60020f27aea0","src/core/code.rs":"0dd762215e487f76d138dd6507679c24bfd747531d989baaa78d7e2382f099e4","src/core/custom.rs":"df2d6a8c5a64603822301522e9df4344022226301df846941d95930f1f4d99c4","src/core/data.rs":"c9d59eab2ab811bd950da52e6766c7df2367986c7a3a0d94d7aeb47d86f203ac","src/core/elements.rs":"361eba770b0bd6129e5b96f3081b022c5fa74640730d1d0501a33d93fea7d707","src/core/exports.rs":"f37351587cd0cfa7608f94e0fcbfa09d41c7df1d123c47825992c364d5d9ff11","src/core/functions.rs":"c18b9872ac0c21048a3ce32e5e44e8e702f97a57fa1b3a07bdd98c7f6c820f09","src/core/globals.rs":"560d8e8c818d968cd8a101ab3c639f723b1c754716aa1178d1c4570efd84d010","src/core/imports.rs":"782bbc2e70b379831f85716c0f50c0221d1487c8cba26e8845028b2ae1962c0c","src/core/linking.rs":"5c7d5bce822fad92dc096ceafde878c6d25869004ca26dde1378e78ae37071c9","src/core/memories.rs":"840d15fcd9bd4a668298491c6a91455b145c5c7ff1adf8c769aaf49d6c664d3a","src/core/names.rs":"1337a5ab769e1a1b83113041d6fc59652db34a01ef44f14a2641b3748c216dc1","src/core/producers.rs":"e96156e2b87a4e9162b918b8f9cae870c5abc9410835651d74ac54f0ff2665e7","src/core/start.rs":"a01d4a91bcd93048977ccafc6af160357297450395bf598351f5a3e6d322e0de","src/core/tables.rs":"f87a9761002e93c8e04e646cdf19fb5d012b190a4dbba542e8bfe1cfc606b545","src/core/tags.rs":"26d58904871d92f395eed67d4c25f0914b337d213bab2288011abe3ad31fa12b","src/core/types.rs":"42125c08577c418237982980fd13eb9a21e63b52674c0820c2df2e61b5f454fc","src/lib.rs":"aaec7fa68ae0764721d7b4b6d0d935ea60380c6268cbd512480fee2f7a61b755","src/raw.rs":"a6a72cfe8f88ea6476eccee4acf362030ba2d2e5710215bc4f13cde7de6d71ae"},"package":"1c3e4bc09095436c8e7584d86d33e6c3ee67045af8fb262cbb9cc321de553428"}
{"files":{"Cargo.toml":"b96ee82a5f62db5b6f57000e3f1fdab6872b1bed6d36350e9af08d90984b47af","LICENSE":"268872b9816f90fd8e85db5a28d33f8150ebb8dd016653fb39ef1f94f2686bc5","README.md":"ac016c4843a7e1a5737255b39418732783592222dc518020730edf9dd46a1c13","src/component.rs":"b07b239571c54100a258da3fb00d9155c85d3750f93cc24d408ebc17301f3e66","src/component/aliases.rs":"be5215154b872ed5664f3bfe2aa1391f36a2575aa9d53971ab61868a1c446e9d","src/component/canonicals.rs":"8b270caef4e0f1e2b62af5b27560ac370399d11ce411aae6b811dddeaedb7750","src/component/components.rs":"07b8cae3a400e1955cc39d142569910b4fef2136021053d0ddbd6404d810aa52","src/component/exports.rs":"9a685fb44af0cfefbb2e92ddb0259955766cf6d1c0022830a865f92426ce0f7b","src/component/imports.rs":"41414a4cb71d79404e8721a985dd1d3a7df287f6417b4cab017d12e9aef31c43","src/component/instances.rs":"75e0ec12a578aa22d78053add818a960373171ff10c3619ca1e8058ded277a41","src/component/modules.rs":"9e80907e72360fae4d8057b6b0e7a6b58edd7ba6aba6e63ba17346518e169617","src/component/names.rs":"7b651284ffdf147aabf1e01226f34ddc8bbe3d38a2dcd26ca0fc15ad24002b6f","src/component/start.rs":"4055553d5c99c99abbc01bb8abb928ecb8b909d148b647a9977fbd444bb464a3","src/component/types.rs":"02982d0b7962462f0b083ade9a639216cc040775a0426ad431afbf9fbedf664b","src/core.rs":"7b02ef53a430693cfadcfd83f3aa9f556062eb9b9408e661ead5364e2150cd5e","src/core/code.rs":"b340cb948d1e28e8bd369353c729674146bcc28508bbb427a8d249af4fd491fe","src/core/custom.rs":"df2d6a8c5a64603822301522e9df4344022226301df846941d95930f1f4d99c4","src/core/data.rs":"c9d59eab2ab811bd950da52e6766c7df2367986c7a3a0d94d7aeb47d86f203ac","src/core/elements.rs":"76ab78bed1956fad030821b267a115511a99c61f33f2c6e588b5a8d4ee9b4204","src/core/exports.rs":"f37351587cd0cfa7608f94e0fcbfa09d41c7df1d123c47825992c364d5d9ff11","src/core/functions.rs":"c18b9872ac0c21048a3ce32e5e44e8e702f97a57fa1b3a07bdd98c7f6c820f09","src/core/globals.rs":"560d8e8c818d968cd8a101ab3c639f723b1c754716aa1178d1c4570efd84d010","src/core/imports.rs":"782bbc2e70b379831f85716c0f50c0221d1487c8cba26e8845028b2ae1962c0c","src/core/linking.rs":"5c7d5bce822fad92dc096ceafde878c6d25869004ca26dde1378e78ae37071c9","src/core/memories.rs":"840d15fcd9bd4a668298491c6a91455b145c5c7ff1adf8c769aaf49d6c664d3a","src/core/names.rs":"1337a5ab769e1a1b83113041d6fc59652db34a01ef44f14a2641b3748c216dc1","src/core/producers.rs":"e96156e2b87a4e9162b918b8f9cae870c5abc9410835651d74ac54f0ff2665e7","src/core/start.rs":"a01d4a91bcd93048977ccafc6af160357297450395bf598351f5a3e6d322e0de","src/core/tables.rs":"d5ae8c92c8707332eda6be6e5649f2f8042a1c6242494b0174cbee5e1971cace","src/core/tags.rs":"26d58904871d92f395eed67d4c25f0914b337d213bab2288011abe3ad31fa12b","src/core/types.rs":"988175ad3a47f4aca29c7fad9d594b54c5a5717fedf7ecd6296fbb45cb058999","src/lib.rs":"aaec7fa68ae0764721d7b4b6d0d935ea60380c6268cbd512480fee2f7a61b755","src/raw.rs":"a6a72cfe8f88ea6476eccee4acf362030ba2d2e5710215bc4f13cde7de6d71ae"},"package":"4eff853c4f09eec94d76af527eddad4e9de13b11d6286a1ef7134bc30135a2b7"}
2 changes: 1 addition & 1 deletion third_party/rust/wasm-encoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[package]
edition = "2021"
name = "wasm-encoder"
version = "0.23.0"
version = "0.25.0"
authors = ["Nick Fitzgerald <[email protected]>"]
description = """
A low-level WebAssembly encoder.
Expand Down
20 changes: 16 additions & 4 deletions third_party/rust/wasm-encoder/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ const INSTANCE_SORT: u8 = 0x05;
pub trait ComponentSection: Encode {
/// Gets the section identifier for this section.
fn id(&self) -> u8;

/// Appends this section to the specified destination list of bytes.
fn append_to_component(&self, dst: &mut Vec<u8>) {
dst.push(self.id());
self.encode(dst);
}
}

/// Known section identifiers of WebAssembly components.
Expand Down Expand Up @@ -101,13 +107,19 @@ pub struct Component {
}

impl Component {
/// The 8-byte header at the beginning of all components.
#[rustfmt::skip]
pub const HEADER: [u8; 8] = [
// Magic
0x00, 0x61, 0x73, 0x6D,
// Version
0x0c, 0x00, 0x01, 0x00,
];

/// Begin writing a new `Component`.
pub fn new() -> Self {
Self {
bytes: vec![
0x00, 0x61, 0x73, 0x6D, // magic (`\0asm`)
0x0c, 0x00, 0x01, 0x00, // version
],
bytes: Self::HEADER.to_vec(),
}
}

Expand Down
21 changes: 12 additions & 9 deletions third_party/rust/wasm-encoder/src/component/instances.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,34 +59,36 @@ impl InstanceSection {
}

/// Define an instance by instantiating a core module.
pub fn instantiate<'a, A>(&mut self, module_index: u32, args: A) -> &mut Self
pub fn instantiate<A, S>(&mut self, module_index: u32, args: A) -> &mut Self
where
A: IntoIterator<Item = (&'a str, ModuleArg)>,
A: IntoIterator<Item = (S, ModuleArg)>,
A::IntoIter: ExactSizeIterator,
S: AsRef<str>,
{
let args = args.into_iter();
self.bytes.push(0x00);
module_index.encode(&mut self.bytes);
args.len().encode(&mut self.bytes);
for (name, arg) in args {
name.encode(&mut self.bytes);
name.as_ref().encode(&mut self.bytes);
arg.encode(&mut self.bytes);
}
self.num_added += 1;
self
}

/// Define an instance by exporting core WebAssembly items.
pub fn export_items<'a, E>(&mut self, exports: E) -> &mut Self
pub fn export_items<E, S>(&mut self, exports: E) -> &mut Self
where
E: IntoIterator<Item = (&'a str, ExportKind, u32)>,
E: IntoIterator<Item = (S, ExportKind, u32)>,
E::IntoIter: ExactSizeIterator,
S: AsRef<str>,
{
let exports = exports.into_iter();
self.bytes.push(0x01);
exports.len().encode(&mut self.bytes);
for (name, kind, index) in exports {
name.encode(&mut self.bytes);
name.as_ref().encode(&mut self.bytes);
kind.encode(&mut self.bytes);
index.encode(&mut self.bytes);
}
Expand Down Expand Up @@ -146,17 +148,18 @@ impl ComponentInstanceSection {
}

/// Define an instance by instantiating a component.
pub fn instantiate<'a, A>(&mut self, component_index: u32, args: A) -> &mut Self
pub fn instantiate<A, S>(&mut self, component_index: u32, args: A) -> &mut Self
where
A: IntoIterator<Item = (&'a str, ComponentExportKind, u32)>,
A: IntoIterator<Item = (S, ComponentExportKind, u32)>,
A::IntoIter: ExactSizeIterator,
S: AsRef<str>,
{
let args = args.into_iter();
self.bytes.push(0x00);
component_index.encode(&mut self.bytes);
args.len().encode(&mut self.bytes);
for (name, kind, index) in args {
name.encode(&mut self.bytes);
name.as_ref().encode(&mut self.bytes);
kind.encode(&mut self.bytes);
index.encode(&mut self.bytes);
}
Expand Down
4 changes: 2 additions & 2 deletions third_party/rust/wasm-encoder/src/component/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ impl<'a> CoreTypeEncoder<'a> {

self.0.push(0x60);
params.len().encode(self.0);
self.0.extend(params.map(u8::from));
params.for_each(|p| p.encode(self.0));
results.len().encode(self.0);
self.0.extend(results.map(u8::from));
results.for_each(|p| p.encode(self.0));
}

/// Define a module type.
Expand Down
22 changes: 16 additions & 6 deletions third_party/rust/wasm-encoder/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ pub(crate) const CORE_TAG_SORT: u8 = 0x04;
pub trait Section: Encode {
/// Gets the section identifier for this section.
fn id(&self) -> u8;

/// Appends this section to the specified destination list of bytes.
fn append_to(&self, dst: &mut Vec<u8>) {
dst.push(self.id());
self.encode(dst);
}
}

/// Known section identifiers of WebAssembly modules.
Expand Down Expand Up @@ -110,16 +116,20 @@ pub struct Module {
}

impl Module {
/// The 8-byte header at the beginning of all core wasm modules.
#[rustfmt::skip]
pub const HEADER: [u8; 8] = [
// Magic
0x00, 0x61, 0x73, 0x6D,
// Version
0x01, 0x00, 0x00, 0x00,
];

/// Begin writing a new `Module`.
#[rustfmt::skip]
pub fn new() -> Self {
Module {
bytes: vec![
// Magic
0x00, 0x61, 0x73, 0x6D,
// Version
0x01, 0x00, 0x00, 0x00,
],
bytes: Self::HEADER.to_vec(),
}
}

Expand Down
Loading

0 comments on commit d7a441b

Please sign in to comment.