summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lldb/source/Symbol/ClangASTContext.cpp4
-rw-r--r--lldb/source/Symbol/ClangUtil.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/lldb/source/Symbol/ClangASTContext.cpp b/lldb/source/Symbol/ClangASTContext.cpp
index 61b08ab9f51..31b62ebb615 100644
--- a/lldb/source/Symbol/ClangASTContext.cpp
+++ b/lldb/source/Symbol/ClangASTContext.cpp
@@ -3601,7 +3601,7 @@ bool ClangASTContext::IsDefined(lldb::opaque_compiler_type_t type) {
}
bool ClangASTContext::IsObjCClassType(const CompilerType &type) {
- if (type) {
+ if (ClangUtil::IsClangType(type)) {
clang::QualType qual_type(ClangUtil::GetCanonicalQualType(type));
const clang::ObjCObjectPointerType *obj_pointer_type =
@@ -3886,7 +3886,7 @@ bool ClangASTContext::IsBeingDefined(lldb::opaque_compiler_type_t type) {
bool ClangASTContext::IsObjCObjectPointerType(const CompilerType &type,
CompilerType *class_type_ptr) {
- if (!type)
+ if (!ClangUtil::IsClangType(type))
return false;
clang::QualType qual_type(ClangUtil::GetCanonicalQualType(type));
diff --git a/lldb/source/Symbol/ClangUtil.cpp b/lldb/source/Symbol/ClangUtil.cpp
index 86be895fadc..71ff36a5eba 100644
--- a/lldb/source/Symbol/ClangUtil.cpp
+++ b/lldb/source/Symbol/ClangUtil.cpp
@@ -15,6 +15,10 @@ using namespace clang;
using namespace lldb_private;
bool ClangUtil::IsClangType(const CompilerType &ct) {
+ // Invalid types are never Clang types.
+ if (!ct)
+ return false;
+
if (llvm::dyn_cast_or_null<ClangASTContext>(ct.GetTypeSystem()) == nullptr)
return false;
OpenPOWER on IntegriCloud