From e5270598bacecce555a0d3c088af5b0888331e2a Mon Sep 17 00:00:00 2001 From: Sean Callanan Date: Fri, 26 Apr 2013 22:54:19 +0000 Subject: [PATCH] Hardening to avoid null-pointer crashes in the presence of malformed class types. llvm-svn: 180645 --- lldb/source/Expression/ClangExpressionDeclMap.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 1b67efe2b3a2..dfa4e54b8d97 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -1016,6 +1016,9 @@ ClangExpressionDeclMap::FindExternalVisibleDecls (NameSearchContext &context, { 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::FindExternalVisibleDecls (NameSearchContext &context, QualType class_type = class_pointer_type->getPointeeType(); + if (!class_type.getAsOpaquePtr()) + return; + if (log) { ASTDumper ast_dumper(self_type->GetClangFullType());