Skip to content

Commit 8e9932c

Browse files
Merge pull request swiftlang#9641 from adrian-prantl/cherry-pick-next-lldb-Acquire-the-map-lock-after-deriving-the-lookup-key
[Cherry-pick into next] [lldb] Acquire the map lock after deriving the lookup key
2 parents 126659b + 662aa3c commit 8e9932c

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1911,7 +1911,6 @@ SwiftASTContext *TypeSystemSwiftTypeRefForExpressions::GetSwiftASTContext(
19111911
SwiftASTContext *TypeSystemSwiftTypeRef::GetSwiftASTContextOrNull(
19121912
const SymbolContext &sc) const {
19131913
std::lock_guard<std::mutex> guard(m_swift_ast_context_lock);
1914-
19151914
const char *key = nullptr;
19161915
auto it = m_swift_ast_context_map.find(key);
19171916
if (it != m_swift_ast_context_map.end())
@@ -1921,9 +1920,9 @@ SwiftASTContext *TypeSystemSwiftTypeRef::GetSwiftASTContextOrNull(
19211920

19221921
SwiftASTContext *TypeSystemSwiftTypeRefForExpressions::GetSwiftASTContextOrNull(
19231922
const SymbolContext &sc) const {
1924-
std::lock_guard<std::mutex> guard(m_swift_ast_context_lock);
1925-
19261923
const char *key = DeriveKeyFor(sc);
1924+
1925+
std::lock_guard<std::mutex> guard(m_swift_ast_context_lock);
19271926
auto it = m_swift_ast_context_map.find(key);
19281927
if (it != m_swift_ast_context_map.end())
19291928
return llvm::cast_or_null<SwiftASTContext>(it->second.typesystem.get());

0 commit comments

Comments
 (0)