mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SIL Optimizer: Fix bug in EscapeAnalysis::isReachable()
We weren't clearing the worklist flags if returning true here. Oops! This would manifest as alias analysis returning different results for the same operands over time, which confused ARC code motion into dropping release instructions.
This commit is contained in:
@@ -561,8 +561,10 @@ bool EscapeAnalysis::ConnectionGraph::isReachable(CGNode *From, CGNode *To) {
|
||||
From->isInWorkList = true;
|
||||
for (unsigned Idx = 0; Idx < WorkList.size(); ++Idx) {
|
||||
CGNode *Reachable = WorkList[Idx];
|
||||
if (Reachable == To)
|
||||
if (Reachable == To) {
|
||||
clearWorkListFlags(WorkList);
|
||||
return true;
|
||||
}
|
||||
for (Predecessor Pred : Reachable->Preds) {
|
||||
CGNode *PredNode = Pred.getPointer();
|
||||
if (!PredNode->isInWorkList) {
|
||||
|
||||
Reference in New Issue
Block a user