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

Issue 316002: Fix some shadow variables, including one in file_id.cc that causes all files to generate the same... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 1 month ago by Lei Zhang (chromium)
Modified:
13 years ago
CC:
google-breakpad-dev_googlegroups.com
Base URL:
http://google-breakpad.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Fix some shadow variables, including one in file_id.cc that causes all files to
generate the same hash. Add a test to make sure this doesn't happen again.

committed as r875.

Patch Set 1 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M src/client/linux/minidump_writer/minidump_writer.cc View 1 chunk +2 lines, -2 lines 2 comments Download
M src/common/linux/file_id.cc View 5 chunks +7 lines, -11 lines 0 comments Download
M src/common/linux/file_id_unittest.cc View 2 chunks +101 lines, -0 lines 0 comments Download
M src/common/stabs_reader.cc View 5 chunks +6 lines, -6 lines 0 comments Download
M src/processor/source_line_resolver_base.cc View 4 chunks +7 lines, -7 lines 0 comments Download
M src/tools/linux/md2core/minidump-2-core.cc View 2 chunks +4 lines, -4 lines 0 comments Download

Messages

Total messages: 6
Lei Zhang (chromium)
13 years, 1 month ago #1
Mark Mentovai
Wow. LGTM http://breakpad.appspot.com/316002/diff/1/2 File src/client/linux/minidump_writer/minidump_writer.cc (right): http://breakpad.appspot.com/316002/diff/1/2#newcode674 Line 674: for (unsigned j = 0; j ...
13 years, 1 month ago #2
Ted Mielczarek
Ugh. Turns out I found this same bug in my code, and I have a ...
13 years, 1 month ago #3
Mark Mentovai
Ted, you said that about another bug in recent memory too. Anything else sitting in ...
13 years, 1 month ago #4
shess
http://breakpad.appspot.com/316002/diff/1/2 File src/client/linux/minidump_writer/minidump_writer.cc (right): http://breakpad.appspot.com/316002/diff/1/2#newcode674 Line 674: for (unsigned j = 0; j < dumper_.mappings().size(); ...
13 years, 1 month ago #5
Lei Zhang (chromium)
13 years, 1 month ago #6
On 2011/10/20 18:16:59, shess wrote:
> http://breakpad.appspot.com/316002/diff/1/2
> File src/client/linux/minidump_writer/minidump_writer.cc (right):
> 
> http://breakpad.appspot.com/316002/diff/1/2#newcode674
> Line 674: for (unsigned j = 0; j < dumper_.mappings().size(); ++j) {
> On 2011/10/20 13:35:30, Mark Mentovai wrote:
> > This is exactly why i and j are terrible name for loop variables.
> 
> Is there no compiler willing to provide warnings on this?  Surely the number
of
> times this is done accidentally grossly outnumbers the legitimate cases.

-Wshadow will catch these, but it also complains about this pattern, which we
have a lot of.

class Bar {
 public:
  int foo() { return foo_; }
  void set_foo(int foo) { foo_ = foo }; // param shadows a method of this.
 private:
  int foo_;
};
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted