fix some mudflap failures

Richard Henderson rth@redhat.com
Tue Jan 4 18:48:00 GMT 2005


Almost all of the 50-ish failures currently in the tree are due to
a think-o in extracting the variable name.

Tested i686-linux.


r~


        * tree-mudflap.c (mf_varname_tree): Fix thinko setting declname.

Index: tree-mudflap.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-mudflap.c,v
retrieving revision 2.34
diff -c -p -d -r2.34 tree-mudflap.c
*** tree-mudflap.c	2 Jan 2005 22:20:02 -0000	2.34
--- tree-mudflap.c	4 Jan 2005 18:46:04 -0000
***************
*** 1,5 ****
  /* Mudflap: narrow-pointer bounds-checking by tree rewriting.
!    Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
     Contributed by Frank Ch. Eigler <fche@redhat.com>
     and Graydon Hoare <graydon@redhat.com>
  
--- 1,5 ----
  /* Mudflap: narrow-pointer bounds-checking by tree rewriting.
!    Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
     Contributed by Frank Ch. Eigler <fche@redhat.com>
     and Graydon Hoare <graydon@redhat.com>
  
*************** mf_varname_tree (tree decl)
*** 161,167 ****
  
    /* Add <variable-declaration>, possibly demangled.  */
    {
!     const char *declname = "<unnamed variable>";
  
      if (DECL_NAME (decl) != NULL)
        {
--- 161,167 ----
  
    /* Add <variable-declaration>, possibly demangled.  */
    {
!     const char *declname = NULL;
  
      if (DECL_NAME (decl) != NULL)
        {
*************** mf_varname_tree (tree decl)
*** 175,180 ****
--- 175,182 ----
  	if (declname == NULL)
  	  declname = lang_hooks.decl_printable_name (decl, 3);
        }
+     if (declname == NULL)
+       declname = "<unnamed variable>";
  
      pp_string (buf, declname);
    }



More information about the Gcc-patches mailing list