Skip to content

Commit 571b63a

Browse files
committed
[Swift] lldb: Fix local var redeclaration error
I assume the error fell out of #10593, which apparently was not built/tested. (cherry picked from commit 58d795c)
1 parent c8f494a commit 571b63a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

lldb/source/Plugins/Language/Swift/FoundationValueTypes.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -672,13 +672,16 @@ class URLComponentsSyntheticChildrenFrontEnd
672672
m_synth_frontend_up->Update();
673673

674674
#define COMPONENT(Name, PrettyName, ID) \
675-
auto index_or_err = m_synth_frontend_up->GetIndexOfChildWithName(g__##Name); \
676-
if (!index_or_err) { \
677-
LLDB_LOG_ERROR(GetLog(LLDBLog::DataFormatters), index_or_err.takeError(), \
678-
"{0}"); \
679-
return ChildCacheState::eRefetch; \
675+
{ \
676+
auto index_or_err = \
677+
m_synth_frontend_up->GetIndexOfChildWithName(g__##Name); \
678+
if (!index_or_err) { \
679+
LLDB_LOG_ERROR(GetLog(LLDBLog::DataFormatters), \
680+
index_or_err.takeError(), "{0}"); \
681+
return ChildCacheState::eRefetch; \
682+
} \
683+
m_##Name = m_synth_frontend_up->GetChildAtIndex(*index_or_err).get(); \
680684
} \
681-
m_##Name = m_synth_frontend_up->GetChildAtIndex(*index_or_err).get(); \
682685
if (m_##Name) \
683686
m_##Name->SetName(GetNameFor##Name());
684687
#include "URLComponents.def"

0 commit comments

Comments
 (0)