This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug symtab/17789] New: SYMBOL_DEMANGLED_NAME can return NULL


https://sourceware.org/bugzilla/show_bug.cgi?id=17789

            Bug ID: 17789
           Summary: SYMBOL_DEMANGLED_NAME can return NULL
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: xdje42 at gmail dot com

While working on cleaning up some of gdb's mangled/demangled name handling I
noticed this:

symtab.h:

/* Return the demangled name for a symbol based on the language for
   that symbol.  If no demangled name exists, return NULL.  */
#define SYMBOL_DEMANGLED_NAME(symbol) \
  (symbol_demangled_name (&(symbol)->ginfo))
extern const char *symbol_demangled_name
  (const struct general_symbol_info *symbol);

valops.c:

            fprintf_filtered (gdb_stderr,
                              "Overloaded function instance "
                              "%s # of parms %d\n",
                              SYMBOL_DEMANGLED_NAME (oload_syms[ix]),
                              nparms);

[there's no check for NULL]

Perhaps it "can't happen", but it's not easy enough to tell.
Filing this so I don't forget about it.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]