Author: Shafik Yaghmour Date: 2022-03-30T18:00:37-07:00 New Revision: 14cad95d38235df6c5fd5dd3da84b91fa69e7e74
URL: https://github.com/llvm/llvm-project/commit/14cad95d38235df6c5fd5dd3da84b91fa69e7e74 DIFF: https://github.com/llvm/llvm-project/commit/14cad95d38235df6c5fd5dd3da84b91fa69e7e74.diff LOG: [LLDB] Fix NSIndexPathSyntheticFrontEnd::Impl::Clear() to only clear the active union member NSIndexPathSyntheticFrontEnd::Impl::Clear() currently calls Clear() on both unions members regardless of which one is active. I modified it to only call Clear() on the active member. Differential Revision: https://reviews.llvm.org/D122753 Added: Modified: lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp Removed: ################################################################################ diff --git a/lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp b/lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp index 8db75716e1862..429633e5e6b87 100644 --- a/lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp +++ b/lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp @@ -282,9 +282,17 @@ class NSIndexPathSyntheticFrontEnd : public SyntheticChildrenFrontEnd { }; void Clear() { + switch (m_mode) { + case Mode::Inlined: + m_inlined.Clear(); + break; + case Mode::Outsourced: + m_outsourced.Clear(); + break; + case Mode::Invalid: + break; + } m_mode = Mode::Invalid; - m_inlined.Clear(); - m_outsourced.Clear(); } Impl() {} _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits