Merge pull request #46 from paritytech/unknown-target-start

wasm-unknown-unknown: remove start section from a module
This commit is contained in:
Nikolay Volf 2018-01-10 11:49:48 +04:00 committed by GitHub
commit a228b43f19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,7 +125,15 @@ fn main() {
let mut module = parity_wasm::deserialize_file(&path).unwrap();
if let source::SourceTarget::Unknown = source_input.target() {
module = underscore_funcs(module)
module = underscore_funcs(module);
// Removes the start section for 'wasm32-unknown-unknown' target if exists
module.sections_mut().retain(|section| {
if let &elements::Section::Start(ref _a) = section {
false
} else {
true
}
});
}
if let Some(runtime_type) = matches.value_of("runtime_type") {