Store module name on wasmtime_environ::Module (#1309)

* Store module name on `wasmtime_environ::Module`

This keeps all name information in one place so we dont' have to keep
extra structures around in `wasmtime::Module`.

* rustfmt
This commit is contained in:
Alex Crichton
2020-03-13 17:51:10 -05:00
committed by GitHub
parent 922b49744b
commit 65e32b3660
8 changed files with 47 additions and 47 deletions

View File

@@ -429,9 +429,13 @@ pub fn parse_name_section<'data>(
environ.declare_func_name(index, name)?;
}
}
return Ok(());
}
wasmparser::Name::Local(_) | wasmparser::Name::Module(_) => {}
wasmparser::Name::Module(module) => {
if let Ok(name) = module.get_name() {
environ.declare_module_name(name)?;
}
}
wasmparser::Name::Local(_) => {}
};
}
Ok(())