X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=binutils%2Fwrstabs.c;h=3e941dcefd5816fa3a54ce9fe4fb8544b06d0a6a;hb=ff8577f64987a898e1dc5eb6afb66a404fb7bb16;hp=54a14af3ebb919a61dae131de9d6f7394a745f34;hpb=2571583aed598dd3f9651b53434e5f177a0e3cf7;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/wrstabs.c b/binutils/wrstabs.c index 54a14af3eb..3e941dcefd 100644 --- a/binutils/wrstabs.c +++ b/binutils/wrstabs.c @@ -1,5 +1,5 @@ /* wrstabs.c -- Output stabs debugging information - Copyright (C) 1996-2017 Free Software Foundation, Inc. + Copyright (C) 1996-2019 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GNU Binutils. @@ -1440,18 +1440,15 @@ stab_end_struct_type (void *p) /* 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); @@ -1472,17 +1469,16 @@ stab_start_class_type (void *p, const char *tag, unsigned int id, bfd_boolean st } 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; }