mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-03 13:14:45 +01:00
Fix dangling pointer in forward_ref_die_to_func
Bug: google-breakpad:843 Change-Id: I14358b239604e1faeb5a8c4c4734102571dbed09 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2951787 Reviewed-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
parent
322eb2b4c6
commit
a524a1e24b
5 changed files with 26 additions and 22 deletions
|
|
@ -80,13 +80,13 @@ void Module::SetAddressRanges(const vector<Range>& ranges) {
|
|||
address_ranges_ = ranges;
|
||||
}
|
||||
|
||||
void Module::AddFunction(Function* function) {
|
||||
bool Module::AddFunction(Function* function) {
|
||||
// FUNC lines must not hold an empty name, so catch the problem early if
|
||||
// callers try to add one.
|
||||
assert(!function->name.empty());
|
||||
|
||||
if (!AddressIsInModule(function->address)) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// FUNCs are better than PUBLICs as they come with sizes, so remove an extern
|
||||
|
|
@ -120,14 +120,9 @@ void Module::AddFunction(Function* function) {
|
|||
if (!ret.second && (*ret.first != function)) {
|
||||
// Free the duplicate that was not inserted because this Module
|
||||
// now owns it.
|
||||
delete function;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void Module::AddFunctions(vector<Function*>::iterator begin,
|
||||
vector<Function*>::iterator end) {
|
||||
for (vector<Function*>::iterator it = begin; it != end; ++it)
|
||||
AddFunction(*it);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Module::AddStackFrameEntry(StackFrameEntry* stack_frame_entry) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue