Fix a source of memory corruption.

This error was causing crashes in official Chrome Mac builds on 10.8.5
machines.

BUG=chromium:449214
R=mark@chromium.org


git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1414 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
erikchen@chromium.org 2015-01-26 23:19:04 +00:00
parent c332a1dcba
commit efa0310455

View file

@ -396,6 +396,18 @@ string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() {
enclosing_name = &parent_context_->name;
}
// Prepare the return value before upcoming mutations possibly invalidate the
// existing pointers.
string return_value;
if (qualified_name) {
return_value = *qualified_name;
} else {
// Combine the enclosing name and unqualified name to produce our
// own fully-qualified name.
return_value = cu_context_->language->MakeQualifiedName(*enclosing_name,
*unqualified_name);
}
// If this DIE was marked as a declaration, record its names in the
// specification table.
if (declaration_) {
@ -409,13 +421,7 @@ string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() {
cu_context_->file_context->file_private_->specifications[offset_] = spec;
}
if (qualified_name)
return *qualified_name;
// Combine the enclosing name and unqualified name to produce our
// own fully-qualified name.
return cu_context_->language->MakeQualifiedName(*enclosing_name,
*unqualified_name);
return return_value;
}
// A handler class for DW_TAG_subprogram DIEs.