This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [4.1 patch] relocate profile data file


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]