From patchwork Mon May 23 21:06:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rong Xu X-Patchwork-Id: 97062 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 607E5B6F9D for ; Tue, 24 May 2011 07:07:05 +1000 (EST) Received: (qmail 14722 invoked by alias); 23 May 2011 21:07:04 -0000 Received: (qmail 14714 invoked by uid 22791); 23 May 2011 21:07:03 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 May 2011 21:06:49 +0000 Received: from wpaz1.hot.corp.google.com (wpaz1.hot.corp.google.com [172.24.198.65]) by smtp-out.google.com with ESMTP id p4NL6l1D013344; Mon, 23 May 2011 14:06:47 -0700 Received: from rong.mtv.corp.google.com (rong.mtv.corp.google.com [172.18.110.233]) by wpaz1.hot.corp.google.com with ESMTP id p4NL6ju0004901; Mon, 23 May 2011 14:06:46 -0700 Received: by rong.mtv.corp.google.com (Postfix, from userid 104659) id BB12DC4414; Mon, 23 May 2011 14:06:45 -0700 (PDT) To: reply@codereview.appspotmail.com, gcc-patches@gcc.gnu.org Subject: [google] initialize eof_pos (issue4553059) Message-Id: <20110523210645.BB12DC4414@rong.mtv.corp.google.com> Date: Mon, 23 May 2011 14:06:45 -0700 (PDT) From: xur@google.com (Rong Xu) X-System-Of-Record: true Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * 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 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) {