Fix crash exposed by r328025
authorPavel Labath <labath@google.com>
Wed, 21 Mar 2018 11:10:57 +0000 (11:10 +0000)
committerPavel Labath <labath@google.com>
Wed, 21 Mar 2018 11:10:57 +0000 (11:10 +0000)
commit03a77e9a3909037e88d5479557a61275702b7f7c
treeb1d7b907bb18d978327413141d5f2483e04650df
parent369e97511db857e3b2c100eab61af0319eec0179
Fix crash exposed by r328025

The issue was that the ASTDumper was being passed a null pointer
(because we did not create any declaration for the operator==).  The
crash was in logging code, so it only manifested it self if you ran the
tests with logging enabled (like our bots do).

Given that this is logging code and the rest of the debugger is fine
with the declaration being null, I just make sure the logging code can
handle it as well. Right now I just do the null check in
ClangExpressionDeclMap, but if the ASTDumper class is meant to be a
debugging/logging aid, then it might be a good idea move the check
inside the class itself.

llvm-svn: 328088
lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp