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

Unified Diff: src/common/dwarf_cu_to_module.cc

Issue 9754002: Fix some fragile code that is likely to cause future memory corruption problems. Base URL: http://google-breakpad.googlecode.com/svn/trunk/
Patch Set: Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/common/linux/elf_symbols_to_module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/common/dwarf_cu_to_module.cc
===================================================================
--- src/common/dwarf_cu_to_module.cc (revision 1413)
+++ src/common/dwarf_cu_to_module.cc (working copy)
@@ -528,18 +528,19 @@
// functions that were never used), but all the ones we're
// interested in cover a non-empty range of bytes.
if (low_pc_ < high_pc_) {
- // Create a Module::Function based on the data we've gathered, and
- // add it to the functions_ list.
- scoped_ptr<Module::Function> func(new Module::Function);
// Malformed DWARF may omit the name, but all Module::Functions must
// have names.
+ string name;
if (!name_.empty()) {
- func->name = name_;
+ name = name_;
} else {
cu_context_->reporter->UnnamedFunction(offset_);
- func->name = "<name omitted>";
+ name = "<name omitted>";
}
- func->address = low_pc_;
+
+ // Create a Module::Function based on the data we've gathered, and
+ // add it to the functions_ list.
+ scoped_ptr<Module::Function> func(new Module::Function(name, low_pc_));
func->size = high_pc_ - low_pc_;
func->parameter_size = 0;
if (func->address) {
« no previous file with comments | « no previous file | src/common/linux/elf_symbols_to_module.cc » ('j') | no next file with comments »

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