We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e95c7c commit 874c7c8Copy full SHA for 874c7c8
include/swift/SIL/InstWrappers.h
@@ -257,8 +257,12 @@ class ForwardingOperation {
257
// ForwardingInstruction.swift mirrors this implementation.
258
Operand *getSingleForwardingOperand() const {
259
switch (forwardingInst->getKind()) {
260
- case SILInstructionKind::StructInst:
261
case SILInstructionKind::TupleInst:
+ case SILInstructionKind::StructInst: {
262
+ if (forwardingInst->getNumRealOperands() != 1)
263
+ return nullptr;
264
+ return *forwardingInst->getRealOperands().begin();
265
+ }
266
case SILInstructionKind::LinearFunctionInst:
267
case SILInstructionKind::DifferentiableFunctionInst:
268
return nullptr;
0 commit comments