shafik created this revision.
shafik added reviewers: labath, aprantl, JDevlieghere.
Herald added a subscriber: arphaman.
Herald added a project: All.
shafik requested review of this revision.
`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.
https://reviews.llvm.org/D122753
Files:
lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp
Index: lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp
===================================================================
--- lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp
+++ lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp
@@ -282,9 +282,17 @@
};
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() {}
Index: lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp
===================================================================
--- lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp
+++ lldb/source/Plugins/Language/ObjC/NSIndexPath.cpp
@@ -282,9 +282,17 @@
};
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
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits