Harden the checks on the type returned from the
AST importer because we're seeing occasional
crashes.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@151541 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangASTSource.cpp b/source/Expression/ClangASTSource.cpp
index 3376bd1..593b617 100644
--- a/source/Expression/ClangASTSource.cpp
+++ b/source/Expression/ClangASTSource.cpp
@@ -1300,6 +1300,11 @@
SetImportInProgress(false);
+ if (ret_qual_type->getCanonicalTypeInternal().isNull())
+ // this shouldn't happen, but we're hardening because the AST importer seems to be generating bad types
+ // on occasion.
+ return NULL;
+
return ret;
}