This commit is contained in:
Mackenzie Clark
2019-03-28 11:42:59 -07:00
parent 5294eb6b0d
commit c684ea46f0
3 changed files with 8 additions and 7 deletions

View File

@ -67,11 +67,13 @@ pub fn compile_with(
compiler: &dyn backend::Compiler,
) -> CompileResult<module::Module> {
let token = backend::Token::generate();
compiler.compile(wasm, Default::default(), token).map(|mut inner| {
let inner_info: &mut crate::module::ModuleInfo = &mut inner.info;
inner_info.import_custom_sections(wasm).unwrap();
module::Module::new(Arc::new(inner))
})
compiler
.compile(wasm, Default::default(), token)
.map(|mut inner| {
let inner_info: &mut crate::module::ModuleInfo = &mut inner.info;
inner_info.import_custom_sections(wasm).unwrap();
module::Module::new(Arc::new(inner))
})
}
/// The same as `compile_with` but changes the compiler behavior