X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=binutils%2Fwrstabs.c;h=34c9ef9d2db9fa3030333ddb2d8f2c72b6970565;hb=60318db6c5459d73ac6fa1ff6d44ca17d797a1aa;hp=3d1839f131e2e2275fcfd5990a6fd17ec602e6f3;hpb=827041555ac443bd57340060f3e034fd7b199dd8;p=deliverable%2Fbinutils-gdb.git diff --git a/binutils/wrstabs.c b/binutils/wrstabs.c index 3d1839f131..34c9ef9d2d 100644 --- a/binutils/wrstabs.c +++ b/binutils/wrstabs.c @@ -1,5 +1,5 @@ /* wrstabs.c -- Output stabs debugging information - Copyright (C) 1996-2019 Free Software Foundation, Inc. + Copyright (C) 1996-2020 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; }