]> sourceware.org Git - libabigail.git/commit
dwarf-reader: Bug 26908 - don't crash on empty DW_TAG_partial_unit libabigail-1.8
authorDodji Seketeli <dodji@redhat.com>
Mon, 30 Nov 2020 04:53:11 +0000 (05:53 +0100)
committerDodji Seketeli <dodji@redhat.com>
Mon, 30 Nov 2020 05:58:37 +0000 (06:58 +0100)
commit2417efb2b7619ed2a2bd089d267833ee9d171eea
tree8744a3a430d3a47fde623834fa452c707f82e896
parent264c8338cc2f5769fc21cf5c619bfa31cc5a0372
dwarf-reader: Bug 26908 - don't crash on empty DW_TAG_partial_unit

Sometimes a DW_TAG_partial_unit (imported via a DW_TAG_imported_unit)
has no children node.  That means the the DW_TAG_partial_unit has no
sub-tree.

In those cases, the dwarf-reader crashes when
ctxt.build_die_parent_relations_under tries to record the point at
which the sub-tree (which is non-existent here) of the partial unit is
imported by the DW_TAG_imported_unit DIE.

This patch avoids crashing in those cases.  As this problem is
reported on libclang-cpp.so (on Fedora 33) which takes "abidw --abidiff"
five hours and ~ 20GB of ram to complete at this point (on a power7 box)
this patch doesn't have a regression test attached.

* src/abg-dwarf-reader.cc (die_has_children): Define new static
function.
(read_context::build_die_parent_relations_under): Do not try to
instantiate an imported_unit_point type for an imported unit with
no children node.
(imported_unit_point::imported_unit_point): Assert that the
imported die has a sub-tree.
(imported_unit_point::imported_unit_point): Remove useless spaces.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-dwarf-reader.cc
This page took 0.033778 seconds and 5 git commands to generate.