[Lldb-commits] [lldb] r135989 - /lldb/trunk/source/Symbol/ClangASTType.cpp

Enrico Granata granata.enrico at gmail.com
Mon Jul 25 15:19:19 PDT 2011


Author: enrico
Date: Mon Jul 25 17:19:19 2011
New Revision: 135989

URL: http://llvm.org/viewvc/llvm-project?rev=135989&view=rev
Log:
bug fix in ClangASTType when trying to get size of a non-complete type

Modified:
    lldb/trunk/source/Symbol/ClangASTType.cpp

Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=135989&r1=135988&r2=135989&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Mon Jul 25 17:19:19 2011
@@ -1373,9 +1373,13 @@
                 clang::ASTContext *ast_context,
                 lldb::clang_type_t opaque_clang_qual_type)
 {
-    clang::QualType qual_type(clang::QualType::getFromOpaquePtr(opaque_clang_qual_type));
     
-    return (ast_context->getTypeSize (qual_type) + 7) / 8;
+    if (ClangASTContext::GetCompleteType (ast_context, opaque_clang_qual_type))
+    {
+        clang::QualType qual_type(clang::QualType::getFromOpaquePtr(opaque_clang_qual_type));
+        return (ast_context->getTypeSize (qual_type) + 7) / 8;
+    }
+    return UINT32_MAX;
 }
 
 





More information about the lldb-commits mailing list