mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Distributed] Inject "unsafe" expression for synthesized unsafe code
This commit is contained in:
@@ -156,7 +156,7 @@ deriveBodyDistributed_doInvokeOnReturn(AbstractFunctionDecl *afd, void *arg) {
|
||||
new (C) VarDecl(/*isStatic=*/false, VarDecl::Introducer::Let, sloc,
|
||||
C.getIdentifier("result"), afd);
|
||||
{
|
||||
auto resultLoadCall = CallExpr::createImplicit(
|
||||
Expr *resultLoadCall = CallExpr::createImplicit(
|
||||
C,
|
||||
UnresolvedDotExpr::createImplicit(
|
||||
C,
|
||||
@@ -171,6 +171,9 @@ deriveBodyDistributed_doInvokeOnReturn(AbstractFunctionDecl *afd, void *arg) {
|
||||
new (C) DeclRefExpr(ConcreteDeclRef(returnTypeParam),
|
||||
dloc, implicit))}));
|
||||
|
||||
if (C.LangOpts.hasFeature(Feature::StrictMemorySafety))
|
||||
resultLoadCall = new (C) UnsafeExpr(sloc, resultLoadCall, Type(), true);
|
||||
|
||||
auto resultPattern = NamedPattern::createImplicit(C, resultVar);
|
||||
auto resultPB = PatternBindingDecl::createImplicit(
|
||||
C, swift::StaticSpellingKind::None, resultPattern,
|
||||
|
||||
Reference in New Issue
Block a user