[Lldb-commits] [lldb] r180645 - Hardening to avoid null-pointer crashes in the

Sean Callanan scallanan at apple.com
Fri Apr 26 15:54:19 PDT 2013


Author: spyffe
Date: Fri Apr 26 17:54:19 2013
New Revision: 180645

URL: http://llvm.org/viewvc/llvm-project?rev=180645&view=rev
Log:
Hardening to avoid null-pointer crashes in the
presence of malformed class types.

<rdar://problem/13740646>

Modified:
    lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp

Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=180645&r1=180644&r2=180645&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Fri Apr 26 17:54:19 2013
@@ -1016,6 +1016,9 @@ ClangExpressionDeclMap::FindExternalVisi
                     {
                         QualType class_type = class_pointer_type->getPointeeType();
                         
+                        if (!class_type.getAsOpaquePtr())
+                            return;
+                        
                         if (log)
                         {
                             ASTDumper ast_dumper(this_type->GetClangFullType());
@@ -1144,6 +1147,9 @@ ClangExpressionDeclMap::FindExternalVisi
                     
                         QualType class_type = class_pointer_type->getPointeeType();
                         
+                        if (!class_type.getAsOpaquePtr())
+                            return;
+                        
                         if (log)
                         {
                             ASTDumper ast_dumper(self_type->GetClangFullType());





More information about the lldb-commits mailing list