This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix segfault with dump files
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 08 Nov 2017 00:59:20 +0100
- Subject: Fix segfault with dump files
- Authentication-results: sourceware.org; auth=none
Some old Solaris libcs don't like being passed a NULL pointer as the string
parameter corresponding to the %s marker of formatting functions.
Fixed thusly, tested on SPARC/Solaris, applied on the mainline as obvious.
2017-11-07 Eric Botcazou <ebotcazou@adacore.com>
* gimple-pretty-print.c (dump_profile): Return "" instead of NULL.
--
Eric Botcazou
Index: gimple-pretty-print.c
===================================================================
--- gimple-pretty-print.c (revision 254449)
+++ gimple-pretty-print.c (working copy)
@@ -86,7 +86,7 @@ dump_profile (profile_count &count)
{
char *buf;
if (!count.initialized_p ())
- return NULL;
+ return "";
if (count.ipa_p ())
buf = xasprintf ("[count: %" PRId64 "]",
count.to_gcov_type ());