Author: teemperor Date: Fri Jul 5 14:32:39 2019 New Revision: 365247 URL: http://llvm.org/viewvc/llvm-project?rev=365247&view=rev Log: [lldb] Added assert to VerifyDecl
We could VerifyDecl sometimes with a nullptr. It would be nice if we could get an actual assert here instead of triggering UB. Modified: lldb/trunk/source/Symbol/VerifyDecl.cpp Modified: lldb/trunk/source/Symbol/VerifyDecl.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/VerifyDecl.cpp?rev=365247&r1=365246&r2=365247&view=diff ============================================================================== --- lldb/trunk/source/Symbol/VerifyDecl.cpp (original) +++ lldb/trunk/source/Symbol/VerifyDecl.cpp Fri Jul 5 14:32:39 2019 @@ -9,4 +9,7 @@ #include "lldb/Symbol/VerifyDecl.h" #include "clang/AST/DeclBase.h" -void lldb_private::VerifyDecl(clang::Decl *decl) { decl->getAccess(); } +void lldb_private::VerifyDecl(clang::Decl *decl) { + assert(decl && "VerifyDecl called with nullptr?"); + decl->getAccess(); +} _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits