Cleanup a switch-case logic to avoid a GCC 7.2.1 warning
authorDodji Seketeli <dodji@redhat.com>
Wed, 11 Oct 2017 13:13:46 +0000 (15:13 +0200)
committerDodji Seketeli <dodji@redhat.com>
Wed, 11 Oct 2017 13:13:46 +0000 (15:13 +0200)
* src/abg-dwarf-reader.cc (die_qualified_type_name): Cleanup a
switch case to make the form support more what we meant, and shut
down a GCC 7.2.1 warning.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-dwarf-reader.cc

index 15ec5e71c3d6fd4932a4263507e68623340d8385..601b2d88c00eee306b97f77d3416cd1706b50e3f 100644 (file)
@@ -10102,22 +10102,26 @@ die_qualified_type_name(const read_context& ctxt,
       break;
 
     case DW_TAG_typedef:
-      {
-       Dwarf_Die underlying_type_die;
-       if (die_die_attribute(die, DW_AT_type, underlying_type_die))
-         {
-           string n = die_qualified_type_name(ctxt, &underlying_type_die,
-                                              where_offset);
-           if (die_is_unspecified(&underlying_type_die)
-               || n.empty())
-             break;
-         }
-      }
     case DW_TAG_enumeration_type:
     case DW_TAG_structure_type:
     case DW_TAG_class_type:
     case DW_TAG_union_type:
       {
+       if (tag == DW_TAG_typedef)
+         {
+           // If the underlying type of the typedef is unspecified,
+           // bail out as we don't support that yet.
+           Dwarf_Die underlying_type_die;
+           if (die_die_attribute(die, DW_AT_type, underlying_type_die))
+             {
+               string n = die_qualified_type_name(ctxt, &underlying_type_die,
+                                                  where_offset);
+               if (die_is_unspecified(&underlying_type_die)
+                   || n.empty())
+                 break;
+             }
+         }
+
        if (name.empty())
          {
            if (tag == DW_TAG_structure_type || tag == DW_TAG_class_type)