Skip to content

Commit 3a36baf

Browse files
Merge pull request #37198 from adrian-prantl/75905336-1-5.5
Allow functions marked @LLDBDebuggerFunction to bypass actor isolatio…
2 parents ec097d6 + 2a01301 commit 3a36baf

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,6 +2329,10 @@ void swift::checkTopLevelActorIsolation(TopLevelCodeDecl *decl) {
23292329
}
23302330

23312331
void swift::checkFunctionActorIsolation(AbstractFunctionDecl *decl) {
2332+
// Disable this check for @LLDBDebuggerFunction functions.
2333+
if (decl->getAttrs().hasAttribute<LLDBDebuggerFunctionAttr>())
2334+
return;
2335+
23322336
ActorIsolationChecker checker(decl);
23332337
if (auto body = decl->getBody()) {
23342338
body->walk(checker);
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// RUN: %target-typecheck-verify-swift -enable-experimental-concurrency -debugger-support
2+
// REQUIRES: concurrency
3+
4+
// This test simulates LLDB's expression evaluator makeing an otherwise illegal
5+
// synchronous call into an extension of an actor, as it would to run `p n` in
6+
// this example.
7+
8+
actor A {
9+
var n : Int = 0
10+
}
11+
12+
extension A {
13+
final func lldb_wrapped_expr() {
14+
n = 1
15+
}
16+
}
17+
18+
@LLDBDebuggerFunction
19+
func lldb_expr(a: A) {
20+
a.lldb_wrapped_expr()
21+
}

0 commit comments

Comments
 (0)