(
module: &mut ModuleContext<'a>,
exports: wasmparser::ExportSectionReader<'a>,
)
| 105 | } |
| 106 | |
| 107 | fn export_section<'a>( |
| 108 | module: &mut ModuleContext<'a>, |
| 109 | exports: wasmparser::ExportSectionReader<'a>, |
| 110 | ) -> wasmtime::Result<()> { |
| 111 | for export in exports { |
| 112 | let export = export?; |
| 113 | |
| 114 | if export.name.starts_with("__wizer_") { |
| 115 | wasmtime::bail!( |
| 116 | "input Wasm module already exports entities named with the `__wizer_*` prefix" |
| 117 | ); |
| 118 | } |
| 119 | |
| 120 | match export.kind { |
| 121 | wasmparser::ExternalKind::Tag |
| 122 | | wasmparser::ExternalKind::Func |
| 123 | | wasmparser::ExternalKind::FuncExact |
| 124 | | wasmparser::ExternalKind::Table |
| 125 | | wasmparser::ExternalKind::Memory |
| 126 | | wasmparser::ExternalKind::Global => { |
| 127 | module.push_export(export); |
| 128 | } |
| 129 | } |
| 130 | } |
| 131 | Ok(()) |
| 132 | } |
no test coverage detected