Skip to content

Commit

Permalink
Don't emit empty DWARF sections (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda authored Dec 2, 2024
1 parent 27f6b62 commit 94522dc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/module/debug/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,12 @@ impl Emit for ModuleDebugData {
sections
.for_each(
|id: SectionId, data: &write::EndianVec<LittleEndian>| -> Result<()> {
cx.wasm_module.section(&wasm_encoder::CustomSection {
name: id.name().into(),
data: data.slice().into(),
});
if !data.slice().is_empty() {
cx.wasm_module.section(&wasm_encoder::CustomSection {
name: id.name().into(),
data: data.slice().into(),
});
}
Ok(())
},
)
Expand Down

0 comments on commit 94522dc

Please sign in to comment.