From: Eric Botcazou Date: Thu, 6 Nov 2008 11:42:52 +0000 (+0000) Subject: misc.c (gnat_printable_name): Always return a copy in GC memory. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=baf6e6a838df2137989ae6301150b1c0ddd0b87c;p=platform%2Fupstream%2Fgcc.git misc.c (gnat_printable_name): Always return a copy in GC memory. * gcc-interface/misc.c (gnat_printable_name): Always return a copy in GC memory. From-SVN: r141638 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 6730093..5e9f8b7 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,10 @@ 2008-11-06 Eric Botcazou + * gcc-interface/misc.c (gnat_printable_name): Always return a copy + in GC memory. + +2008-11-06 Eric Botcazou + PR ada/19419 * gcc-interface/trans.c (gnat_to_gnu) : Generate a call to memmove for an assignment between overlapping diff --git a/gcc/ada/gcc-interface/misc.c b/gcc/ada/gcc-interface/misc.c index 7c7dc02..3026e90 100644 --- a/gcc/ada/gcc-interface/misc.c +++ b/gcc/ada/gcc-interface/misc.c @@ -603,10 +603,10 @@ gnat_printable_name (tree decl, int verbosity) if (verbosity == 2) { Set_Identifier_Casing (ada_name, (char *) DECL_SOURCE_FILE (decl)); - ada_name = Name_Buffer; + return ggc_strdup (Name_Buffer); } - - return (const char *) ada_name; + else + return ada_name; } /* Expands GNAT-specific GCC tree nodes. The only ones we support