Skip to content

Commit 34e3aae

Browse files
committed
Don't emit empty DWARF sections
1 parent 27f6b62 commit 34e3aae

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/module/debug/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,12 @@ impl Emit for ModuleDebugData {
115115
sections
116116
.for_each(
117117
|id: SectionId, data: &write::EndianVec<LittleEndian>| -> Result<()> {
118-
cx.wasm_module.section(&wasm_encoder::CustomSection {
119-
name: id.name().into(),
120-
data: data.slice().into(),
121-
});
118+
if !data.slice().is_empty() {
119+
cx.wasm_module.section(&wasm_encoder::CustomSection {
120+
name: id.name().into(),
121+
data: data.slice().into(),
122+
});
123+
}
122124
Ok(())
123125
},
124126
)

0 commit comments

Comments
 (0)