Skip to content

Commit

Permalink
PR comment
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-François <[email protected]>
  • Loading branch information
bilboquet committed Sep 20, 2024
1 parent f8bd4e8 commit 9609ff8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/middlewares/condom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ impl ModuleMiddleware for CondomMiddleware {
}

// Check the import limits
#[cfg_attr(feature = "enable-serde", serde(with = "serde_imports"))]
if let Some(max_imports) = self.limits.max_imports_len {
if module_info.imports.len() > max_imports {
return Err(MiddlewareError::new(
Expand Down Expand Up @@ -1214,23 +1213,20 @@ mod tests {
let name_len = 256;
let fn_name_len = 256;
let custon_section_data_len = 1_000_000;
// exporting all 10_000 fn causes the wasmparser to fail because of
// internal limits
// set nb_exports to 1000 seems reasonable
let nb_exports = nb_fn;
let nb_imports_fn = 100;
let nb_imports_fn = 256;
let nb_imports_mem = 1;
let nb_table_ini = nb_fn;
let nb_passive_elm = nb_fn;
let nb_passive_data = 512;
let nb_global_ini = 512;
let nb_tables = 15;
let nb_tables = 16;
let nb_memories = 1; // only 1 supported so far (cf specification)

let nb_locals = 512;

let condom_limits = CondomLimits {
max_exports: Some(nb_exports),
max_exports: Some(nb_exports + nb_global_ini),
max_functions: Some(nb_fn + nb_imports_fn),
max_signature_len: Some(nb_params + nb_return_values),
max_name_len: Some(name_len),
Expand Down

0 comments on commit 9609ff8

Please sign in to comment.