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
This commit is contained in:
Jim Ingham 2012-04-19 00:17:05 +00:00
parent 1f628f4e8f
commit e1471230e2
1 changed files with 5 additions and 4 deletions

View File

@ -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