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

Unified Diff: src/common/stabs_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 9 years, 2 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 | « src/common/module_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/common/stabs_to_module.cc
===================================================================
--- src/common/stabs_to_module.cc (revision 1413)
+++ src/common/stabs_to_module.cc (working copy)
@@ -90,9 +90,7 @@
bool StabsToModule::StartFunction(const string &name,
uint64_t address) {
assert(!current_function_);
- Module::Function *f = new Module::Function;
- f->name = Demangle(name);
- f->address = address;
+ Module::Function *f = new Module::Function(Demangle(name), address);
f->size = 0; // We compute this in StabsToModule::Finalize().
f->parameter_size = 0; // We don't provide this information.
current_function_ = f;
@@ -133,7 +131,7 @@
}
bool StabsToModule::Extern(const string &name, uint64_t address) {
- Module::Extern *ext = new Module::Extern;
+ Module::Extern *ext = new Module::Extern(address);
// Older libstdc++ demangle implementations can crash on unexpected
// input, so be careful about what gets passed in.
if (name.compare(0, 3, "__Z") == 0) {
@@ -143,7 +141,6 @@
} else {
ext->name = name;
}
- ext->address = address;
module_->AddExtern(ext);
return true;
}
« no previous file with comments | « src/common/module_unittest.cc ('k') | no next file » | no next file with comments »

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