diff options
author | Johnny Chen <johnny.chen@apple.com> | 2010-09-29 21:57:51 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2010-09-29 21:57:51 +0000 |
commit | eb1db1c5477ad7e940551b2c3abd45497ac8be7a (patch) | |
tree | 7cd644a7d7ae1104ef00cfd533057111a113aac6 /lldb/source/Breakpoint/BreakpointIDList.cpp | |
parent | 824645abc93ac6d3e7b8c72f9a7caffb17192915 (diff) | |
download | bcm5719-llvm-eb1db1c5477ad7e940551b2c3abd45497ac8be7a.tar.gz bcm5719-llvm-eb1db1c5477ad7e940551b2c3abd45497ac8be7a.zip |
Verify that we have a valid breakpoint ID before proceeding with retrieving its
number of locations. This fixed a crasher.
llvm-svn: 115092
Diffstat (limited to 'lldb/source/Breakpoint/BreakpointIDList.cpp')
-rw-r--r-- | lldb/source/Breakpoint/BreakpointIDList.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lldb/source/Breakpoint/BreakpointIDList.cpp b/lldb/source/Breakpoint/BreakpointIDList.cpp index 29662486d93..3f3e8a15f91 100644 --- a/lldb/source/Breakpoint/BreakpointIDList.cpp +++ b/lldb/source/Breakpoint/BreakpointIDList.cpp @@ -212,6 +212,13 @@ BreakpointIDList::FindAndReplaceIDRanges (Args &old_args, Target *target, Comman BreakpointID::ParseCanonicalReference (bp_id_str.c_str(), &bp_id, &bp_loc_id); BreakpointSP breakpoint_sp = target->GetBreakpointByID (bp_id); + if (! breakpoint_sp) + { + new_args.Clear(); + result.AppendErrorWithFormat ("'%d' is not a valid breakpoint ID.\n", bp_id); + result.SetStatus (eReturnStatusFailed); + return; + } const size_t num_locations = breakpoint_sp->GetNumLocations(); for (size_t j = 0; j < num_locations; ++j) { |