[Lldb-commits] [lldb] r374231 - [LLDB] Fix for regression of test 'TestDataFormatterInvalidStdUniquePtr.py' introduced in r374195

Cameron Desrochers via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 9 14:15:48 PDT 2019


Author: cameron314
Date: Wed Oct  9 14:15:48 2019
New Revision: 374231

URL: http://llvm.org/viewvc/llvm-project?rev=374231&view=rev
Log:
[LLDB] Fix for regression of test 'TestDataFormatterInvalidStdUniquePtr.py' introduced in r374195

Differential Revision: https://reviews.llvm.org/D68641

Modified:
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp
    lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp?rev=374231&r1=374230&r2=374231&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibCxxTuple.cpp Wed Oct  9 14:15:48 2019
@@ -79,7 +79,9 @@ ValueObjectSP TupleFrontEnd::GetChildAtI
     m_elements[idx] =
         elem_sp->Clone(ConstString(llvm::formatv("[{0}]", idx).str())).get();
 
-  return m_elements[idx]->GetSP();
+  if (m_elements[idx])
+    return m_elements[idx]->GetSP();
+  return ValueObjectSP();
 }
 
 SyntheticChildrenFrontEnd *

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp?rev=374231&r1=374230&r2=374231&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppTuple.cpp Wed Oct  9 14:15:48 2019
@@ -90,7 +90,7 @@ bool LibStdcppTupleSyntheticFrontEnd::Mi
 
 lldb::ValueObjectSP
 LibStdcppTupleSyntheticFrontEnd::GetChildAtIndex(size_t idx) {
-  if (idx < m_members.size())
+  if (idx < m_members.size() && m_members[idx])
     return m_members[idx]->GetSP();
   return lldb::ValueObjectSP();
 }

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp?rev=374231&r1=374230&r2=374231&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp Wed Oct  9 14:15:48 2019
@@ -118,11 +118,11 @@ bool LibStdcppUniquePtrSyntheticFrontEnd
 
 lldb::ValueObjectSP
 LibStdcppUniquePtrSyntheticFrontEnd::GetChildAtIndex(size_t idx) {
-  if (idx == 0)
+  if (idx == 0 && m_ptr_obj)
     return m_ptr_obj->GetSP();
-  if (idx == 1)
+  if (idx == 1 && m_del_obj)
     return m_del_obj->GetSP();
-  if (idx == 2)
+  if (idx == 2 && m_obj_obj)
     return m_obj_obj->GetSP();
   return lldb::ValueObjectSP();
 }




More information about the lldb-commits mailing list