Fix a copy+pasto. No testcase, because the symptoms of dereferencing
authorDan Gohman <gohman@apple.com>
Wed, 21 Dec 2011 21:43:50 +0000 (21:43 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 21 Dec 2011 21:43:50 +0000 (21:43 +0000)
an invalid iterator aren't reproducible.  rdar://10614085.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147098 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/ObjCARC.cpp

index 8e9449f5188bb2aa09d05c38f9189ffed6c11439..b017ba11d829e87764dc109471cc25c901ca2d4d 100644 (file)
@@ -2504,7 +2504,7 @@ ObjCARCOpt::VisitTopDown(BasicBlock *BB,
         Pred = *PI++;
         if (Pred != BB) {
           I = BBStates.find(Pred);
-          if (I == BBStates.end() || I->second.isVisitedTopDown())
+          if (I != BBStates.end() && I->second.isVisitedTopDown())
             MyStates.MergePred(I->second);
         }
       }