dwarves: Check if a member type wasn't found and avoid a NULL deref

This dodges a SEGFAULT at type__check_structs_at_unnatural_alignments()
so that we can finish processing, give the warnings and produce as much
as we can:

  $ pahole examples/fortran95/derived-type.debug
  die__process_unit: DW_TAG_string_type (0x12) @ <0x122> not handled!
  namespace__recode_dwarf_types: couldn't find 0x122 type for 0x116 (member)!
  struct bar {
  	integer(kind=4)            c;                    /*     0     4 */
  	real(kind=4)               d;                    /*     4     4 */

  	/* size: 8, cachelines: 1, members: 2 */
  	/* last cacheline: 8 bytes */
  };
  struct foo {
  	real(kind=4)               a;                    /*     0     4 */
  	struct bar                 x;                    /*     4     8 */
  	<ERROR(__class__fprintf:1519): 0 not found!>

  	/* size: 20, cachelines: 1, members: 3 */
  	/* padding: 8 */
  	/* last cacheline: 20 bytes */
  };
  $

Reported-by: Tom de Vries
Bugtracker: https://github.com/acmel/dwarves/issues/9
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 file changed