You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

wasmparser

Package Overview
Dependencies
Maintainers
0
Versions
270
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wasmparser - cargo Package Compare versions

Comparing version
0.242.0
to
0.243.0
+1
-1
.cargo_vcs_info.json
{
"git": {
"sha1": "8ebed07de87638d991e144fa5b79b904b1758987"
"sha1": "d05406062d031ae96146486f58a965d87eefea5e"
},
"path_in_vcs": "crates/wasmparser"
}

@@ -592,3 +592,3 @@ # This file is automatically @generated by Cargo.

name = "wasmparser"
version = "0.242.0"
version = "0.243.0"
dependencies = [

@@ -595,0 +595,0 @@ "anyhow",

@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO

name = "wasmparser"
version = "0.242.0"
version = "0.243.0"
authors = ["Yury Delendik <ydelendik@mozilla.com>"]

@@ -19,0 +19,0 @@ build = "build.rs"

@@ -164,21 +164,10 @@ /* Copyright 2024 Mozilla Foundation

let ty = module.sub_type_at(ty)?;
let descriptor = if let Some(_) = ty.composite_type.descriptor_idx {
1
} else {
0
};
let (params, _results) = module.sub_type_arity(ty)?;
Some((params + descriptor, 1))
Some((params, 1))
}
fn visit_struct_new_default(module: &dyn ModuleArity, ty: u32) -> Option<(u32, u32)> {
fn visit_struct_new_desc(module: &dyn ModuleArity, ty: u32) -> Option<(u32, u32)> {
let ty = module.sub_type_at(ty)?;
Some((
if let Some(_) = ty.composite_type.descriptor_idx {
1
} else {
0
},
1,
))
let (params, _results) = module.sub_type_arity(ty)?;
Some((params + 1, 1))
}

@@ -185,0 +174,0 @@

@@ -69,3 +69,3 @@ use crate::{

ComponentExternalKind::Module => ComponentTypeRef::Module(reader.read()?),
ComponentExternalKind::Func => ComponentTypeRef::Func(reader.read()?),
ComponentExternalKind::Func => ComponentTypeRef::Func(reader.read_var_u32()?),
ComponentExternalKind::Value => ComponentTypeRef::Value(reader.read()?),

@@ -72,0 +72,0 @@ ComponentExternalKind::Type => ComponentTypeRef::Type(reader.read()?),

@@ -36,2 +36,4 @@ /* Copyright 2018 Mozilla Foundation

Tag,
/// The external kind is a function with the exact type.
FuncExact,
}

@@ -54,3 +56,11 @@

name: reader.read_string()?,
kind: reader.read()?,
kind: match reader.read()? {
ExternalKind::FuncExact => {
bail!(
reader.original_position(),
"Exact type is not allowed in the exports",
);
}
x => x,
},
index: reader.read_var_u32()?,

@@ -57,0 +67,0 @@ })

@@ -25,4 +25,2 @@ /* Copyright 2018 Mozilla Foundation

/// The type is a function.
///
/// The value is an index into the type section.
Func(u32),

@@ -41,2 +39,4 @@ /// The type is a table.

Tag(TagType),
/// The type is a function.
FuncExact(u32),
}

@@ -72,2 +72,3 @@

ExternalKind::Func => TypeRef::Func(reader.read_var_u32()?),
ExternalKind::FuncExact => TypeRef::FuncExact(reader.read_var_u32()?),
ExternalKind::Table => TypeRef::Table(reader.read()?),

@@ -74,0 +75,0 @@ ExternalKind::Memory => TypeRef::Memory(reader.read()?),

@@ -132,2 +132,5 @@ /* Copyright 2019 Mozilla Foundation

fn is_function_referenced(&self, idx: u32) -> bool;
/// Returns whether the function defined with the exact type.
fn has_function_exact_type(&self, idx: u32) -> bool;
}

@@ -187,2 +190,5 @@

}
fn has_function_exact_type(&self, idx: u32) -> bool {
T::has_function_exact_type(self, idx)
}
}

@@ -257,2 +263,6 @@

}
fn has_function_exact_type(&self, idx: u32) -> bool {
T::has_function_exact_type(self, idx)
}
}

@@ -405,2 +405,10 @@ //! State relating to validating a WebAssembly module.

}};
(@visit $self:ident visit_struct_new_desc $type_index:ident) => {{
$self.validate_gc("struct.new_desc")?;
$self.validator().visit_struct_new_desc($type_index)
}};
(@visit $self:ident visit_struct_new_default_desc $type_index:ident) => {{
$self.validate_gc("struct.new_default_desc")?;
$self.validator().visit_struct_new_default_desc($type_index)
}};
(@visit $self:ident visit_array_new $type_index:ident) => {{

@@ -496,2 +504,3 @@ $self.validate_gc("array.new")?;

pub function_references: Set<u32>,
pub exact_function_imports: Set<u32>,
pub imports: IndexMap<(String, String), Vec<EntityType>>,

@@ -518,2 +527,3 @@ pub exports: IndexMap<String, EntityType>,

function_references: Default::default(),
exact_function_imports: Default::default(),
imports: Default::default(),

@@ -561,2 +571,9 @@ exports: Default::default(),

}
TypeRef::FuncExact(type_index) => {
self.functions.push(type_index);
self.exact_function_imports
.insert(self.num_imported_functions);
self.num_imported_functions += 1;
(self.functions.len(), MAX_WASM_FUNCTIONS, "functions")
}
TypeRef::Table(ty) => {

@@ -683,2 +700,6 @@ self.tables.push(ty);

}
TypeRef::FuncExact(type_index) => {
self.func_type_at(*type_index, types, offset)?;
EntityType::FuncExact(self.types[*type_index as usize])
}
TypeRef::Table(t) => {

@@ -945,3 +966,3 @@ self.check_table_type(t, types, offset)?;

Ok(match export.kind {
ExternalKind::Func => {
ExternalKind::Func | ExternalKind::FuncExact => {
check("function", export.index, self.functions.len())?;

@@ -1109,2 +1130,10 @@ self.function_references.insert(export.index);

}
fn has_function_exact_type(&self, idx: u32) -> bool {
if idx >= self.module.num_imported_functions {
true
} else {
self.module.exact_function_imports.contains(&idx)
}
}
}

@@ -1190,2 +1219,10 @@

}
fn has_function_exact_type(&self, idx: u32) -> bool {
if idx >= self.0.num_imported_functions {
true
} else {
self.0.exact_function_imports.contains(&idx)
}
}
}

@@ -1192,0 +1229,0 @@

@@ -394,2 +394,5 @@ use super::operators::{Frame, OperatorValidator, OperatorValidatorAllocations};

}
fn has_function_exact_type(&self, _idx: u32) -> bool {
todo!()
}
}

@@ -396,0 +399,0 @@

@@ -263,2 +263,4 @@ //! Types relating to type information provided by validation.

Tag(CoreTypeId),
/// The entity is a function with exact type.
FuncExact(CoreTypeId),
}

@@ -275,2 +277,3 @@

Self::Tag(_) => "tag",
Self::FuncExact(_) => "func_exact",
}

@@ -281,3 +284,3 @@ }

match self {
Self::Func(id) | Self::Tag(id) => types[*id].type_info(types),
Self::Func(id) | Self::Tag(id) | Self::FuncExact(id) => types[*id].type_info(types),
Self::Table(_) | Self::Memory(_) | Self::Global(_) => TypeInfo::new(),

@@ -553,2 +556,3 @@ }

TypeRef::Func(idx) => EntityType::Func(*module.types.get(idx as usize)?),
TypeRef::FuncExact(idx) => EntityType::FuncExact(*module.types.get(idx as usize)?),
TypeRef::Table(ty) => EntityType::Table(ty),

@@ -568,3 +572,3 @@ TypeRef::Memory(ty) => EntityType::Memory(ty),

TypesRefKind::Module(module) => Some(match export.kind {
ExternalKind::Func => EntityType::Func(
ExternalKind::Func | ExternalKind::FuncExact => EntityType::Func(
module.types[*module.functions.get(export.index as usize)? as usize],

@@ -571,0 +575,0 @@ ),

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display