[all-commits] [llvm/llvm-project] 0a412b: [LLDB][ClangExpression] Prevent nullptr namespace ...

Michael137 via All-commits all-commits at lists.llvm.org
Tue Jul 26 07:47:56 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0a412b3505f42558573e0d9005d4fe7c6102d8c9
      https://github.com/llvm/llvm-project/commit/0a412b3505f42558573e0d9005d4fe7c6102d8c9
  Author: Michael Buch <michaelbuch12 at gmail.com>
  Date:   2022-07-26 (Tue, 26 Jul 2022)

  Changed paths:
    M lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp

  Log Message:
  -----------
  [LLDB][ClangExpression] Prevent nullptr namespace map access during logging

Some codepaths lead to `namespace_map == nullptr` when we get to
`ClangASTSource::FindCompleteType`. This occurred while debugging
an lldb session that had `settings set target.import-std-module true`.

In that case, with `LLDBLog::Expressions` logging enabled, we would
dereference a `nullptr` and crash.

This commit moves the logging until after we check for `nullptr`.

**Testing**

* Fixed the specific crash I was seeing while debugging an `lldb`
  session with `import-std-module` enabled.

Differential Revision: https://reviews.llvm.org/D130561




More information about the All-commits mailing list