+2019-04-30 Alan Modra <amodra@gmail.com>
+
+ * wrstabs.c (stab_start_class_type): Add assert to work around
+ gcc9 warning. Tidy.
+
2019-04-24 Nick Clifton <nickc@redhat.com>
* objcopy.c (strip_main): Do not enable note merging by default if
/* Start outputting a class. */
static bfd_boolean
-stab_start_class_type (void *p, const char *tag, unsigned int id, bfd_boolean structp, unsigned int size, bfd_boolean vptr, bfd_boolean ownvptr)
+stab_start_class_type (void *p, const char *tag, unsigned int id,
+ bfd_boolean structp, unsigned int size,
+ bfd_boolean vptr, bfd_boolean ownvptr)
{
struct stab_write_handle *info = (struct stab_write_handle *) p;
- bfd_boolean definition;
- char *vstring;
+ bfd_boolean definition = FALSE;
+ char *vstring = NULL;
- if (! vptr || ownvptr)
- {
- definition = FALSE;
- vstring = NULL;
- }
- else
+ if (vptr && !ownvptr)
{
definition = info->type_stack->definition;
vstring = stab_pop_type (info);
}
else
{
+ assert (vstring);
vtable = (char *) xmalloc (strlen (vstring) + 3);
sprintf (vtable, "~%%%s", vstring);
free (vstring);
+ if (definition)
+ info->type_stack->definition = TRUE;
}
-
info->type_stack->vtable = vtable;
}
- if (definition)
- info->type_stack->definition = TRUE;
-
return TRUE;
}