Patchwork [google] initialize eof_pos (issue4553059)

login
register
mail settings
Submitter Rong Xu
Date May 23, 2011, 9:06 p.m.
Message ID <20110523210645.BB12DC4414@rong.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/97062/
State New
Headers show

Comments

Rong Xu - May 23, 2011, 9:06 p.m.
Add the initializtion for eof_pos. eof_pos may not be initialized properly
when part of gcda files got merged.

Tested with gcc bootstrap and regression tests. 

2011-05-23  Rong Xu  <xur@google.com>

	* gcc/libgcov.c	(gcov_merge_gcda_file): initialize eof_pos for
	every invocation.


--
This patch is available for review at http://codereview.appspot.com/4553059
Xinliang David Li - May 23, 2011, 9:32 p.m.
ok for google/main.

David

On Mon, May 23, 2011 at 2:06 PM, Rong Xu <xur@google.com> wrote:
> Add the initializtion for eof_pos. eof_pos may not be initialized properly
> when part of gcda files got merged.
>
> Tested with gcc bootstrap and regression tests.
>
> 2011-05-23  Rong Xu  <xur@google.com>
>
>        * gcc/libgcov.c (gcov_merge_gcda_file): initialize eof_pos for
>        every invocation.
>
> Index: gcc/libgcov.c
> ===================================================================
> --- gcc/libgcov.c       (revision 174088)
> +++ gcc/libgcov.c       (working copy)
> @@ -748,6 +748,8 @@
>   int error = 0;
>   gcov_unsigned_t tag, length;
>
> +  eof_pos = 0;
> +
>   tag = gcov_read_unsigned ();
>   if (tag)
>     {
>
> --
> This patch is available for review at http://codereview.appspot.com/4553059
>

Patch

Index: gcc/libgcov.c
===================================================================
--- gcc/libgcov.c	(revision 174088)
+++ gcc/libgcov.c	(working copy)
@@ -748,6 +748,8 @@ 
   int error = 0;
   gcov_unsigned_t tag, length;
 
+  eof_pos = 0;
+
   tag = gcov_read_unsigned ();
   if (tag)
     {