[Lldb-commits] [PATCH] D130561: [LLDB][ClangExpression] Prevent nullptr namespace map access during logging

Michael Buch via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jul 26 07:48:00 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG0a412b3505f4: [LLDB][ClangExpression] Prevent nullptr namespace map access during logging (authored by Michael137).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130561/new/

https://reviews.llvm.org/D130561

Files:
  lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp


Index: lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
===================================================================
--- lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
+++ lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
@@ -191,12 +191,12 @@
     ClangASTImporter::NamespaceMapSP namespace_map =
         m_ast_importer_sp->GetNamespaceMap(namespace_context);
 
-    LLDB_LOGV(log, "      CTD Inspecting namespace map{0} ({1} entries)",
-              namespace_map.get(), namespace_map->size());
-
     if (!namespace_map)
       return nullptr;
 
+    LLDB_LOGV(log, "      CTD Inspecting namespace map{0} ({1} entries)",
+              namespace_map.get(), namespace_map->size());
+
     for (const ClangASTImporter::NamespaceMapItem &item : *namespace_map) {
       LLDB_LOG(log, "      CTD Searching namespace {0} in module {1}",
                item.second.GetName(), item.first->GetFileSpec().GetFilename());


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130561.447685.patch
Type: text/x-patch
Size: 965 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220726/fc85307b/attachment.bin>


More information about the lldb-commits mailing list