Patchwork [google] fix insane runs in gcda file (issue5490057)

login
register
mail settings
Submitter Rong Xu
Date Dec. 16, 2011, 10:37 p.m.
Message ID <20111216223713.C6D38C160A@rong.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/131930/
State New
Headers show

Comments

Rong Xu - Dec. 16, 2011, 10:37 p.m.
Hi,

This patch fixes the insane values in runs and run_max field of the 
program summary. This can happen when the gcda files manually removed
from the output directory after the merge happens.

This is for google branch only.

Tested with (make; make check).

-Rong

2011-12-16   Rong Xu  <xur@google.com>

	* libgcc/libgcov.c (gcov_merge_gcda_file): reset summary_pos.


--
This patch is available for review at http://codereview.appspot.com/5490057
Xinliang David Li - Dec. 16, 2011, 10:43 p.m.
Ok for google branches -- not applicable to trunk.

David

On Fri, Dec 16, 2011 at 2:37 PM, Rong Xu <xur@google.com> wrote:
> Hi,
>
> This patch fixes the insane values in runs and run_max field of the
> program summary. This can happen when the gcda files manually removed
> from the output directory after the merge happens.
>
> This is for google branch only.
>
> Tested with (make; make check).
>
> -Rong
>
> 2011-12-16   Rong Xu  <xur@google.com>
>
>        * libgcc/libgcov.c (gcov_merge_gcda_file): reset summary_pos.
>
> Index: libgcc/libgcov.c
> ===================================================================
> --- libgcc/libgcov.c    (revision 182398)
> +++ libgcc/libgcov.c    (working copy)
> @@ -810,6 +810,7 @@
>   gcov_unsigned_t tag, length;
>
>   eof_pos = 0;
> +  summary_pos = 0;
>
>   tag = gcov_read_unsigned ();
>   if (tag)
>
> --
> This patch is available for review at http://codereview.appspot.com/5490057

Patch

Index: libgcc/libgcov.c
===================================================================
--- libgcc/libgcov.c	(revision 182398)
+++ libgcc/libgcov.c	(working copy)
@@ -810,6 +810,7 @@ 
   gcov_unsigned_t tag, length;
 
   eof_pos = 0;
+  summary_pos = 0;
 
   tag = gcov_read_unsigned ();
   if (tag)