Skip to content

Commit 1678354

Browse files
committed
Fix an obvious bug in InteriorPointerOperand::findTransitiveUses().
The return value was inverted, meaning the OSSA utilities simply bailed out in most cases. Fixing this means potentially exposing other OSSA bugs.
1 parent 5426d50 commit 1678354

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/SIL/Utils/OwnershipUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ bool swift::findTransitiveUsesForAddress(
807807

808808
// We were able to recognize all of the uses of the address, so return false
809809
// that we did not find any errors.
810-
return foundError;
810+
return !foundError;
811811
}
812812

813813
//===----------------------------------------------------------------------===//

lib/SIL/Verifier/SILOwnershipVerifier.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ bool SILValueOwnershipChecker::gatherUsers(
376376
<< "Address User: " << *op->getUser();
377377
});
378378
};
379-
foundError |= interiorPointerOperand.findTransitiveUses(
379+
foundError |= !interiorPointerOperand.findTransitiveUses(
380380
nonLifetimeEndingUsers, &onError);
381381
}
382382

0 commit comments

Comments
 (0)