mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-05 05:58:24 +01:00
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.
Review URL: http://breakpad.appspot.com/316002 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@875 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
70698339f6
commit
11582abc27
6 changed files with 127 additions and 30 deletions
|
|
@ -130,7 +130,7 @@ bool StabsReader::ProcessCompilationUnit() {
|
|||
// There may be an N_SO entry whose name ends with a slash,
|
||||
// indicating the directory in which the compilation occurred.
|
||||
// The build directory defaults to NULL.
|
||||
const char *build_directory = NULL;
|
||||
const char *build_directory = NULL;
|
||||
{
|
||||
const char *name = SymbolString();
|
||||
if (name[0] && name[strlen(name) - 1] == '/') {
|
||||
|
|
@ -138,7 +138,7 @@ bool StabsReader::ProcessCompilationUnit() {
|
|||
++iterator_;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// We expect to see an N_SO entry with a filename next, indicating
|
||||
// the start of the compilation unit.
|
||||
{
|
||||
|
|
@ -212,7 +212,7 @@ bool StabsReader::ProcessCompilationUnit() {
|
|||
queued_lines_.clear();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool StabsReader::ProcessFunction() {
|
||||
assert(!iterator_->at_end && iterator_->type == N_FUN);
|
||||
|
|
@ -237,7 +237,7 @@ bool StabsReader::ProcessFunction() {
|
|||
return false;
|
||||
}
|
||||
queued_lines_.clear();
|
||||
|
||||
|
||||
while (!iterator_->at_end) {
|
||||
if (iterator_->type == N_SO || iterator_->type == N_FUN)
|
||||
break;
|
||||
|
|
@ -266,8 +266,8 @@ bool StabsReader::ProcessFunction() {
|
|||
if (!iterator_->at_end) {
|
||||
assert(iterator_->type == N_SO || iterator_->type == N_FUN);
|
||||
if (iterator_->type == N_FUN) {
|
||||
const char *name = SymbolString();
|
||||
if (name[0] == '\0') {
|
||||
const char *symbol_name = SymbolString();
|
||||
if (symbol_name[0] == '\0') {
|
||||
// An N_FUN entry with no name is a terminator for this function;
|
||||
// its value is the function's size.
|
||||
ending_address = function_address + iterator_->value;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue