Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/src/wasm/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,15 @@ impl WasmModuleBuilder {
self.main_func.finish(Vec::new(), &mut self.module.funcs);

self.module.exports.add("main", main_func);

// WasmModuleBuilder::new adds to the WASM module all the functions
// that are labeled as #[wasm_export] or #[module_export]. However,
// not all the functions are used in the final WASM code because
// (ie: some YARA modules are not imported by the rules). This removes
// the functions that are not actually used, reducing the size of the
// compiled rules.
walrus::passes::gc::run(&mut self.module);

self.module
}
}
Expand Down
Loading