Skip to content

Commit 94522dc

Browse files
authored
Don't emit empty DWARF sections (#284)
1 parent 27f6b62 commit 94522dc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/module/debug/mod.rs

+6-4
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)