File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1598,7 +1598,7 @@ void swift::insertDeallocOfCapturedArguments(
15981598 SmallVector<Operand *, 2 > uses;
15991599 auto useFinding = findTransitiveUsesForAddress (asi, &uses);
16001600 InstructionSet users (asi->getFunction ());
1601- if (useFinding != AddressUseKind::Unknown ) {
1601+ if (useFinding == AddressUseKind::NonEscaping ) {
16021602 for (auto use : uses) {
16031603 users.insert (use->getUser ());
16041604 }
@@ -1609,7 +1609,7 @@ void swift::insertDeallocOfCapturedArguments(
16091609 if (isa<UnreachableInst>(terminator))
16101610 continue ;
16111611 SILInstruction *insertionPoint = nullptr ;
1612- if (useFinding != AddressUseKind::Unknown ) {
1612+ if (useFinding == AddressUseKind::NonEscaping ) {
16131613 insertionPoint = &block->front ();
16141614 for (auto &instruction : llvm::reverse (*block)) {
16151615 if (users.contains (&instruction)) {
@@ -2463,6 +2463,7 @@ SILValue swift::getInitOfTemporaryAllocStack(AllocStackInst *asi) {
24632463
24642464 AddressWalkerState state (asi->getFunction ());
24652465 AddressWalker walker (state);
2466+ // Note: ignore pointer escapes for the purpose of finding initializers.
24662467 if (std::move (walker).walk (asi) == AddressUseKind::Unknown ||
24672468 state.foundError )
24682469 return SILValue ();
You can’t perform that action at this time.
0 commit comments