Don't assume all custom sections are dwarf info (#3083)

This incorrectly assumed that we had unparsed dwarf information,
regardless of custom section name. This commit updates the logic to
calculate that by first checking the section name before we set the flag
indicating that there's unparsed debuginfo.
This commit is contained in:
Alex Crichton
2021-07-13 15:53:17 -05:00
committed by GitHub
parent 992d85ae8b
commit 73fd702bb7

View File

@@ -191,12 +191,11 @@ impl<'data> ModuleEnvironment<'data> {
} }
fn register_dwarf_section(&mut self, name: &str, data: &'data [u8]) { fn register_dwarf_section(&mut self, name: &str, data: &'data [u8]) {
if !self.tunables.generate_native_debuginfo && !self.tunables.parse_wasm_debuginfo { if !name.starts_with(".debug_") {
self.result.has_unparsed_debuginfo = true;
return; return;
} }
if !self.tunables.generate_native_debuginfo && !self.tunables.parse_wasm_debuginfo {
if !name.starts_with(".debug_") { self.result.has_unparsed_debuginfo = true;
return; return;
} }
let info = &mut self.result.debuginfo; let info = &mut self.result.debuginfo;