diff mbox series

Fix segfault with dump files

Message ID 4255934.AQ3nRRR1rp@polaris
State New
Headers show
Series Fix segfault with dump files | expand

Commit Message

Eric Botcazou Nov. 7, 2017, 11:59 p.m. UTC
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.
diff mbox series

Patch

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 ());