Skip to content

Commit 57392b1

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.
1 parent 9f8e5e8 commit 57392b1

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
@@ -111,7 +111,7 @@ getTransferringApplyCalleeInfo(SILInstruction *inst) {
111111
return {};
112112

113113
auto *decl = declRef->getDecl();
114-
if (!decl->hasName())
114+
if (!decl || !decl->hasName())
115115
return {};
116116

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

0 commit comments

Comments
 (0)