Add fuzz calls to SBType, SBValue, and SBValueList.
Fixed crashes for SBValue fuzz calls.
And change 'bool SBType::IsPointerType(void)' to
'bool SBType::IsAPointerType(void)' to avoid name collision with the static 'bool SBType::IsPointerType(void *)'
function, which SWIG cannot handle.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@134096 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBType.cpp b/source/API/SBType.cpp
index da37f67..4f20124 100644
--- a/source/API/SBType.cpp
+++ b/source/API/SBType.cpp
@@ -165,7 +165,7 @@
}
bool
-SBType::IsPointerType ()
+SBType::IsAPointerType ()
{
return ClangASTContext::IsPointerType (m_type);
}
@@ -174,7 +174,7 @@
SBType::GetPointeeType ()
{
void *pointee_type = NULL;
- if (IsPointerType ())
+ if (IsAPointerType ())
{
pointee_type = ClangASTType::GetPointeeType (m_type);
}
@@ -187,7 +187,7 @@
const char *name = GetName();
uint64_t byte_size = GetByteSize();
uint64_t num_children = GetNumberChildren (true);
- bool is_ptr = IsPointerType ();
+ bool is_ptr = IsAPointerType ();
description.Printf ("type_name: %s, size: %d bytes", (name != NULL ? name : "<unknown type name>"), byte_size);
if (is_ptr)
diff --git a/source/API/SBValue.cpp b/source/API/SBValue.cpp
index 376bd62..801d15d 100644
--- a/source/API/SBValue.cpp
+++ b/source/API/SBValue.cpp
@@ -353,8 +353,13 @@
SBValue
SBValue::GetChildAtIndex (uint32_t idx)
{
- lldb::DynamicValueType use_dynamic_value = m_opaque_sp->GetUpdatePoint().GetTarget()->GetPreferDynamicValue();
- return GetChildAtIndex (idx, use_dynamic_value);
+ if (m_opaque_sp)
+ {
+ lldb::DynamicValueType use_dynamic_value = m_opaque_sp->GetUpdatePoint().GetTarget()->GetPreferDynamicValue();
+ return GetChildAtIndex (idx, use_dynamic_value);
+ }
+ else
+ return GetChildAtIndex (idx, eNoDynamicValues);
}
SBValue
@@ -416,8 +421,13 @@
SBValue
SBValue::GetChildMemberWithName (const char *name)
{
- lldb::DynamicValueType use_dynamic_value = m_opaque_sp->GetUpdatePoint().GetTarget()->GetPreferDynamicValue();
- return GetChildMemberWithName (name, use_dynamic_value);
+ if (m_opaque_sp)
+ {
+ lldb::DynamicValueType use_dynamic_value = m_opaque_sp->GetUpdatePoint().GetTarget()->GetPreferDynamicValue();
+ return GetChildMemberWithName (name, use_dynamic_value);
+ }
+ else
+ return GetChildMemberWithName (name, eNoDynamicValues);
}
SBValue