[4.1 patch] relocate profile data file

H. J. Lu hjl@lucon.org
Wed May 11 15:34:00 GMT 2005


There is a bug in gcov_exit where prefix_length can be uninitialized.
This patch fixes it.


H.J.
----
2005-05-11  H.J. Lu  <hongjiu.lu@intel.com>

	* libgcov.c (gcov_exit): Set prefix_length to 0 if no relocation
	is needed.

--- gcc/libgcov.c.prefix	2005-05-10 10:41:09.000000000 -0700
+++ gcc/libgcov.c	2005-05-11 08:26:52.000000000 -0700
@@ -212,6 +212,8 @@ gcov_exit (void)
       if (IS_DIR_SEPARATOR (gcov_prefix[prefix_length - 1]))
 	prefix_length--;
     }
+  else
+    prefix_length = 0;
   
   /* Allocate and initialize the filename scratch space.  */
   gi_filename = alloca (prefix_length + gcov_max_filename + 1);



More information about the Gcc-patches mailing list