@@ -1229,11 +1229,14 @@ struct PartitionOpEvaluator {
12291229 // case, if we are not marked explicitly as sending, we do not transfer
12301230 // since the disconnected value is allowed to be resued after we
12311231 // return. If we are passed as a sending parameter, we cannot do this.
1232- if (auto fas = FullApplySite::isa (op.getSourceInst ());
1233- (!fas || !fas.isSending (*op.getSourceOp ())) &&
1234- transferredRegionIsolation.isDisconnected () && calleeIsolationInfo &&
1235- transferredRegionIsolation.hasSameIsolation (calleeIsolationInfo))
1236- return ;
1232+ if (auto *sourceInst = Impl::getSourceInst (op)) {
1233+ if (auto fas = FullApplySite::isa (sourceInst);
1234+ (!fas || !fas.isSending (*op.getSourceOp ())) &&
1235+ transferredRegionIsolation.isDisconnected () &&
1236+ calleeIsolationInfo &&
1237+ transferredRegionIsolation.hasSameIsolation (calleeIsolationInfo))
1238+ return ;
1239+ }
12371240
12381241 // Mark op.getOpArgs()[0] as transferred.
12391242 TransferringOperandState &state = operandToStateMap.get (op.getSourceOp ());
@@ -1581,6 +1584,9 @@ struct PartitionOpEvaluatorBaseImpl : PartitionOpEvaluator<Subclass> {
15811584
15821585 static SILLocation getLoc (SILInstruction *inst) { return inst->getLoc (); }
15831586 static SILLocation getLoc (Operand *op) { return op->getUser ()->getLoc (); }
1587+ static SILInstruction *getSourceInst (const PartitionOp &partitionOp) {
1588+ return partitionOp.getSourceInst ();
1589+ }
15841590 static SILIsolationInfo getIsolationInfo (const PartitionOp &partitionOp) {
15851591 return SILIsolationInfo::get (partitionOp.getSourceInst ());
15861592 }
0 commit comments