Skip to content

Commit 43c5d89

Browse files
Merge pull request swiftlang#37155 from adrian-prantl/75905336-1
Allow functions marked @LLDBDebuggerFunction to bypass actor isolatio…
2 parents 54fea46 + 5fe0c03 commit 43c5d89

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
@@ -2334,6 +2334,10 @@ void swift::checkTopLevelActorIsolation(TopLevelCodeDecl *decl) {
23342334
}
23352335

23362336
void swift::checkFunctionActorIsolation(AbstractFunctionDecl *decl) {
2337+
// Disable this check for @LLDBDebuggerFunction functions.
2338+
if (decl->getAttrs().hasAttribute<LLDBDebuggerFunctionAttr>())
2339+
return;
2340+
23372341
ActorIsolationChecker checker(decl);
23382342
if (auto body = decl->getBody()) {
23392343
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)