Skip to content

Commit 952f2c6

Browse files
authored
Merge pull request #41010 from atrick/fix-findroot
2 parents 3165ea5 + 782ce7c commit 952f2c6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/SIL/Utils/MemAccessUtils.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,8 +854,10 @@ void swift::findGuaranteedReferenceRoots(SILValue value,
854854
while (auto value = worklist.pop()) {
855855
if (auto *arg = dyn_cast<SILPhiArgument>(value)) {
856856
if (auto *terminator = arg->getSingleTerminator()) {
857-
worklist.insert(terminator->getOperand(arg->getIndex()));
858-
continue;
857+
if (terminator->isTransformationTerminator()) {
858+
worklist.insert(terminator->getOperand(0));
859+
continue;
860+
}
859861
}
860862
} else if (auto *inst = value->getDefiningInstruction()) {
861863
if (auto *result =

0 commit comments

Comments
 (0)