Skip to content

Commit 874c7c8

Browse files
committed
[SIL] Multi-op fwds may have single fwding op.
1 parent 2e95c7c commit 874c7c8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/swift/SIL/InstWrappers.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,12 @@ class ForwardingOperation {
257257
// ForwardingInstruction.swift mirrors this implementation.
258258
Operand *getSingleForwardingOperand() const {
259259
switch (forwardingInst->getKind()) {
260-
case SILInstructionKind::StructInst:
261260
case SILInstructionKind::TupleInst:
261+
case SILInstructionKind::StructInst: {
262+
if (forwardingInst->getNumRealOperands() != 1)
263+
return nullptr;
264+
return *forwardingInst->getRealOperands().begin();
265+
}
262266
case SILInstructionKind::LinearFunctionInst:
263267
case SILInstructionKind::DifferentiableFunctionInst:
264268
return nullptr;

0 commit comments

Comments
 (0)