Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3743)

Issue 7322063: [google 4_7] Fix bad merge into coverage_init

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 2 months ago by tejohnson
Modified:
9 years, 7 months ago
Reviewers:
davidxl
CC:
gcc-patches_gcc.gnu.org
Base URL:
svn+ssh://gcc.gnu.org/svn/gcc/branches/google/gcc-4_7/gcc/
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -19 lines) Patch
M coverage.c View 2 chunks +19 lines, -19 lines 0 comments Download

Messages

Total messages: 3
tejohnson
This patch fixes a bad merge from google/integration to google/4_7. Passes regression tests. Ok for ...
11 years, 2 months ago (2013-02-12 21:38:36 UTC) #1
davidxl
ok. The same problem exists in google/main too. David On Tue, Feb 12, 2013 at ...
11 years, 2 months ago (2013-02-12 21:54:32 UTC) #2
tejohnson
11 years, 2 months ago (2013-02-12 22:06:59 UTC) #3
Ok, I will apply the same fix to google/main after appropriate testing.

Teresa

On Tue, Feb 12, 2013 at 1:54 PM, Xinliang David Li <davidxl@google.com> wrote:
> ok. The same problem exists in google/main too.
>
> David
>
> On Tue, Feb 12, 2013 at 1:38 PM, Teresa Johnson <tejohnson@google.com> wrote:
>> This patch fixes a bad merge from google/integration to google/4_7.
>>
>> Passes regression tests. Ok for google/4_7?
>>
>> Thanks,
>> Teresa
>>
>> 2013-02-12  Teresa Johnson  <tejohnson@google.com>
>>
>>         * coverage.c (coverage_init): Move test coverage handling
>>         to the correct location within coverage_init (as in trunk)
>>         to avoid overlapping gcov_open calls.
>>
>> Index: coverage.c
>> ===================================================================
>> --- coverage.c  (revision 195984)
>> +++ coverage.c  (working copy)
>> @@ -2635,25 +2635,6 @@ coverage_init (const char *filename, const char* s
>>    da_base_file_name = XNEWVEC (char, strlen (filename) + 1);
>>    strcpy (da_base_file_name, filename);
>>
>> -  /* Name of bbg file.  */
>> -  if (flag_test_coverage && !flag_compare_debug)
>> -    {
>> -      bbg_file_name = XNEWVEC (char, len + strlen (GCOV_NOTE_SUFFIX) + 1);
>> -      memcpy (bbg_file_name, filename, len);
>> -      strcpy (bbg_file_name + len, GCOV_NOTE_SUFFIX);
>> -      if (!gcov_open (bbg_file_name, -1))
>> -       {
>> -         error ("cannot open %s", bbg_file_name);
>> -         bbg_file_name = NULL;
>> -       }
>> -      else
>> -       {
>> -         gcov_write_unsigned (GCOV_NOTE_MAGIC);
>> -         gcov_write_unsigned (GCOV_VERSION);
>> -         gcov_write_unsigned (local_tick);
>> -       }
>> -    }
>> -
>>    if (profile_data_prefix == 0 && !IS_ABSOLUTE_PATH (source_name))
>>      {
>>        src_name_prefix = getpwd ();
>> @@ -2698,6 +2679,25 @@ coverage_init (const char *filename, const char* s
>>      }
>>    if (flag_auto_profile)
>>      init_auto_profile ();
>> +
>> +  /* Name of bbg file.  */
>> +  if (flag_test_coverage && !flag_compare_debug)
>> +    {
>> +      bbg_file_name = XNEWVEC (char, len + strlen (GCOV_NOTE_SUFFIX) + 1);
>> +      memcpy (bbg_file_name, filename, len);
>> +      strcpy (bbg_file_name + len, GCOV_NOTE_SUFFIX);
>> +      if (!gcov_open (bbg_file_name, -1))
>> +       {
>> +         error ("cannot open %s", bbg_file_name);
>> +         bbg_file_name = NULL;
>> +       }
>> +      else
>> +       {
>> +         gcov_write_unsigned (GCOV_NOTE_MAGIC);
>> +         gcov_write_unsigned (GCOV_VERSION);
>> +         gcov_write_unsigned (local_tick);
>> +       }
>> +    }
>>  }
>>
>>  /* Return True if any type of profiling is enabled which requires linking
>>
>> --
>> This patch is available for review at http://codereview.appspot.com/7322063



-- 
Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b