File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -2296,6 +2296,9 @@ Target::GetScratchTypeSystemForLanguage(lldb::LanguageType language,
2296
2296
// thread) is holding a read lock to the scratch context and
2297
2297
// replacing it could cause a use-after-free later on.
2298
2298
if (GetSwiftScratchContextLock ().try_lock ()) {
2299
+ auto unlock = llvm::make_scope_exit ([this ] {
2300
+ GetSwiftScratchContextLock ().unlock ();
2301
+ });
2299
2302
if (m_use_scratch_typesystem_per_module)
2300
2303
DisplayFallbackSwiftContextErrors (swift_ast_ctx);
2301
2304
else if (StreamSP errs = GetDebugger ().GetAsyncErrorStream ()) {
@@ -2345,7 +2348,6 @@ Target::GetScratchTypeSystemForLanguage(lldb::LanguageType language,
2345
2348
llvm::make_error<llvm::StringError>(" DIAF" , llvm::inconvertibleErrorCode ());
2346
2349
}
2347
2350
}
2348
- GetSwiftScratchContextLock ().unlock ();
2349
2351
}
2350
2352
}
2351
2353
} else if (create_on_demand) {
You can’t perform that action at this time.
0 commit comments