[Lldb-commits] [lldb] r155078 - /lldb/trunk/source/Target/Thread.cpp

Jim Ingham jingham at apple.com
Wed Apr 18 17:17:06 PDT 2012


Author: jingham
Date: Wed Apr 18 19:17:05 2012
New Revision: 155078

URL: http://llvm.org/viewvc/llvm-project?rev=155078&view=rev
Log:
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>

Modified:
    lldb/trunk/source/Target/Thread.cpp

Modified: lldb/trunk/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=155078&r1=155077&r2=155078&view=diff
==============================================================================
--- lldb/trunk/source/Target/Thread.cpp (original)
+++ lldb/trunk/source/Target/Thread.cpp Wed Apr 18 19:17:05 2012
@@ -606,10 +606,11 @@
 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





More information about the lldb-commits mailing list