REALLY fix PR378: crash in scalar evolution analysis
authorChris Lattner <sabre@nondot.org>
Sun, 20 Jun 2004 20:32:16 +0000 (20:32 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 20 Jun 2004 20:32:16 +0000 (20:32 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14275 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/ScalarEvolution.cpp

index 2356412b5ac5f969de6276d6e371414c0c7b0ae9..5701dec4b21ec85b72dc500733d70f3d8b05e579 100644 (file)
@@ -376,6 +376,7 @@ static void GroupByComplexity(std::vector<SCEVHandle> &Ops) {
         // Move it to immediately after i'th element.
         std::swap(Ops[i+1], Ops[j]);
         ++i;   // no need to rescan it.
+        if (i == e-2) return;  // Done!
       }
     }
   }