Skip to content

Commit 39c9340

Browse files
committed
[lldb] Fix return with ternary operator preventing RVO with MSVC.
1 parent 57d6673 commit 39c9340

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lldb/source/Plugins/LanguageRuntime/Swift/SwiftLanguageRuntime.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2341,7 +2341,12 @@ void SwiftLanguageRuntime::Terminate() {
23412341

23422342
ThreadSafeReflectionContext
23432343
SwiftLanguageRuntime::GetReflectionContext() {
2344-
FORWARD(GetReflectionContext);
2344+
// Hand written because the ternary operator prevents RVO when compiling with
2345+
// MSVC.
2346+
assert(m_impl || m_stub);
2347+
if (m_impl)
2348+
return m_impl->GetReflectionContext();
2349+
return m_stub->GetReflectionContext();
23452350
}
23462351

23472352
bool SwiftLanguageRuntime::GetDynamicTypeAndAddress(

0 commit comments

Comments
 (0)