proc: support childless compile units in loadDebugInfoMaps (#1574)

Childless compile units would confuse loadDebugInfoMaps.
No test because I don't know what causes go to invoke GNU As in such a
way that it produces a childless compile unit.

Fixes #1572
This commit is contained in:
Alessandro Arzilli
2019-06-12 00:13:27 +02:00
committed by Derek Parker
parent 72fae3c9c1
commit cce377066a

View File

@ -263,7 +263,9 @@ func (bi *BinaryInfo) loadDebugInfoMaps(image *Image, debugLineBytes []byte, wg
} }
} }
bi.compileUnits = append(bi.compileUnits, cu) bi.compileUnits = append(bi.compileUnits, cu)
cu.endOffset = bi.loadDebugInfoMapsCompileUnit(ctxt, image, reader, cu) if entry.Children {
cu.endOffset = bi.loadDebugInfoMapsCompileUnit(ctxt, image, reader, cu)
}
case dwarf.TagPartialUnit: case dwarf.TagPartialUnit:
reader.SkipChildren() reader.SkipChildren()