Skip to content

Commit b7a2ff5

Browse files
committed
[region-isolation] Fix a nullptr error.
This is triggered by the test case in the next commit. The problem is anonymous closures can be passed here and they do not have a ValueDecl so there isn't a decl for us to use. (cherry picked from commit 57392b1)
1 parent cf183ac commit b7a2ff5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/SILOptimizer/Mandatory/TransferNonSendable.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ getTransferringApplyCalleeInfo(SILInstruction *inst) {
110110
return {};
111111

112112
auto *decl = declRef->getDecl();
113-
if (!decl->hasName())
113+
if (!decl || !decl->hasName())
114114
return {};
115115

116116
return {{decl->getDescriptiveKind(), decl->getName()}};

0 commit comments

Comments
 (0)