<rdar://problem/13194155>

Fixing an issue where threads and frames could get out of sync and cause ValueObjects to fail to retrieve their values correctly

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@177166 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/StackFrameList.cpp b/source/Target/StackFrameList.cpp
index 0a45d33..913456d 100644
--- a/source/Target/StackFrameList.cpp
+++ b/source/Target/StackFrameList.cpp
@@ -250,6 +250,10 @@
 void
 StackFrameList::GetFramesUpTo(uint32_t end_idx)
 {
+    // this makes sure we do not fetch frames for an invalid thread
+    if (m_thread.IsValid() == false)
+        return;
+
     // We've already gotten more frames than asked for, or we've already finished unwinding, return.
     if (m_frames.size() > end_idx || GetAllFramesFetched())
         return;