[Lldb-commits] [PATCH] D116217: [lldb] Fix PR52702 by fixing Mangled::operator!

PoYao Chang via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Dec 26 20:10:08 PST 2021


rZhBoYao added inline comments.


================
Comment at: lldb/source/Core/Mangled.cpp:79-81
 Mangled::operator void *() const {
   return (m_mangled) ? const_cast<Mangled *>(this) : nullptr;
 }
----------------
clayborg wrote:
> Looks like there is a similar bug here in this function as well. We should convert the convert to pointer function here to "operator bool" and add a unit test.
> 
> ```
> explicit operator bool() const { return m_mangled || m_demangled; }
> ```
This change breaks this test: `lldb-shell :: SymbolFile/DWARF/x86/find-qualified-variable.cpp` because the comment in the header file says: "This allows code to check a Mangled object to see if it contains a valid //**mangled name**//", which differs from the comment here, and apparently that's what people's intent was. Modifying `lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:2143` solves this. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D116217



More information about the lldb-commits mailing list