http://llvm.org/bugs/show_bug.cgi?id=11579
lldb::SBValue::CreateValueFromAddress does not verify SBType::GetPointerType succeeds
SBValue::CreateValueFromAddress() should check the validity of type and its derived pointer type
before using it. Add a test case.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@146629 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBValue.cpp b/source/API/SBValue.cpp
index c7ab549..c9f78e2 100644
--- a/source/API/SBValue.cpp
+++ b/source/API/SBValue.cpp
@@ -404,9 +404,8 @@
SBValue::CreateValueFromAddress(const char* name, lldb::addr_t address, SBType type)
{
lldb::SBValue result;
- if (m_opaque_sp)
+ if (m_opaque_sp && type.IsValid() && type.GetPointerType().IsValid())
{
-
SBType real_type(type.GetPointerType());
lldb::DataBufferSP buffer(new lldb_private::DataBufferHeap(&address,sizeof(lldb::addr_t)));