[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
This commit is contained in:
Shafik Yaghmour 2022-03-30 18:00:37 -07:00
parent a4b56d7620
commit 14cad95d38
1 changed files with 10 additions and 2 deletions

View File

@ -282,9 +282,17 @@ protected:
};
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() {}