mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Merge pull request #82868 from rjmccall/dont-capture-defer-isolation-6.2
[6.2] Don't force a capture of an isolated parameter in defer bodies
This commit is contained in:
@@ -136,7 +136,8 @@ void SILGenFunction::emitExpectedExecutorProlog() {
|
||||
// Defer bodies are always called synchronously within their enclosing
|
||||
// function, so the check is unnecessary; in addition, we cannot
|
||||
// necessarily perform the check because the defer may not have
|
||||
// captured the isolated parameter of the enclosing function.
|
||||
// captured the isolated parameter of the enclosing function, and
|
||||
// forcing a capture would cause DI problems in actor initializers.
|
||||
bool wantDataRaceChecks = [&] {
|
||||
if (F.isAsync() || F.isDefer())
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user