summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Thread.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2012-04-19 00:17:05 +0000
committerJim Ingham <jingham@apple.com>2012-04-19 00:17:05 +0000
commite1471230e24a89c307ac4eada5879cd033e4b87b (patch)
tree4f32aa70ef67ecda390ab0be1025dd47ccbd0844 /lldb/source/Target/Thread.cpp
parent1f628f4e8f9fe58b96f84ef55f94887da58ce454 (diff)
downloadbcm5719-llvm-e1471230e24a89c307ac4eada5879cd033e4b87b.tar.gz
bcm5719-llvm-e1471230e24a89c307ac4eada5879cd033e4b87b.zip
The plan stack should never be used while empty. GetCurrentPlan is the entry point to contol logic
for the plan stack, so assert here if it gets called with an empty plan stack. <rdar://problem/11265974> llvm-svn: 155078
Diffstat (limited to 'lldb/source/Target/Thread.cpp')
-rw-r--r--lldb/source/Target/Thread.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index fd06a2c4ee0..c483e5ae3da 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -606,10 +606,11 @@ Thread::DiscardPlan ()
ThreadPlan *
Thread::GetCurrentPlan ()
{
- if (m_plan_stack.empty())
- return NULL;
- else
- return m_plan_stack.back().get();
+ // There will always be at least the base plan. If somebody is mucking with a
+ // thread with an empty plan stack, we should assert right away.
+ assert (!m_plan_stack.empty());
+
+ return m_plan_stack.back().get();
}
ThreadPlanSP
OpenPOWER on IntegriCloud