[Lldb-commits] [lldb] r233298 - Add an assertion for frame[0] being valid in CommandObjectThread.cpp.

Stephane Sezer sas at cd80.net
Thu Mar 26 10:47:35 PDT 2015


Author: sas
Date: Thu Mar 26 12:47:34 2015
New Revision: 233298

URL: http://llvm.org/viewvc/llvm-project?rev=233298&view=rev
Log:
Add an assertion for frame[0] being valid in CommandObjectThread.cpp.

Summary:
This should always be true but sometimes is not, during platform bring
up. As recommended by Jim Ingham, an assertion should be enough here to
help.
This addresses post commit comments in http://reviews.llvm.org/D8554.

Test Plan: Run unit tests.

Reviewers: jasonmolenda, emaste, jingham, clayborg

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D8574

Modified:
    lldb/trunk/source/Commands/CommandObjectThread.cpp

Modified: lldb/trunk/source/Commands/CommandObjectThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectThread.cpp?rev=233298&r1=233297&r2=233298&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectThread.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectThread.cpp Thu Mar 26 12:47:34 2015
@@ -580,8 +580,9 @@ protected:
         if (m_step_type == eStepTypeInto)
         {
             StackFrame *frame = thread->GetStackFrameAtIndex(0).get();
+            assert(frame != nullptr);
 
-            if (frame && frame->HasDebugInformation ())
+            if (frame->HasDebugInformation ())
             {
                 new_plan_sp = thread->QueueThreadPlanForStepInRange (abort_other_plans,
                                                                 frame->GetSymbolContext(eSymbolContextEverything).line_entry.range, 





More information about the lldb-commits mailing list