[Lldb-commits] [lldb] r247641 - Avoid a crash in the test suite where if we have a ObjC "id" type and we ask it for the PointeeType() we would get a CompilerType with a valid TypeSystem, but invalid opaque type, and ClangASTContext::IsClangType() previously would return true saying that it was a valid clang type and it would crash in removing qualifiers from a clang::QualType that was constructed with an NULL opaque type.

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 14 16:55:02 PDT 2015


Author: gclayton
Date: Mon Sep 14 18:55:01 2015
New Revision: 247641

URL: http://llvm.org/viewvc/llvm-project?rev=247641&view=rev
Log:
Avoid a crash in the test suite where if we have a ObjC "id" type and we ask it for the PointeeType() we would get a CompilerType with a valid TypeSystem, but invalid opaque type, and ClangASTContext::IsClangType() previously would return true saying that it was a valid clang type and it would crash in removing qualifiers from a clang::QualType that was constructed with an NULL opaque type.


Modified:
    lldb/trunk/include/lldb/Symbol/ClangASTContext.h

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=247641&r1=247640&r2=247641&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Mon Sep 14 18:55:01 2015
@@ -529,7 +529,7 @@ public:
     static bool
     IsClangType (const CompilerType &ct)
     {
-        return llvm::dyn_cast_or_null<ClangASTContext>(ct.GetTypeSystem()) != nullptr;
+        return llvm::dyn_cast_or_null<ClangASTContext>(ct.GetTypeSystem()) != nullptr && ct.GetOpaqueQualType() != nullptr;
     }
 
     //----------------------------------------------------------------------




More information about the lldb-commits mailing list