Fix the second bug attached to PR504.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20181 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp
index bc86702..aabc96c 100644
--- a/lib/Transforms/Scalar/IndVarSimplify.cpp
+++ b/lib/Transforms/Scalar/IndVarSimplify.cpp
@@ -139,7 +139,7 @@
                 if (It != BasicBlock::iterator(CI)) {
                   // Splice the cast immediately after the operand in question.
                   BasicBlock::InstListType &InstList =
-                    I->getParent()->getInstList();
+                    It->getParent()->getInstList();
                   InstList.splice(It, CI->getParent()->getInstList(), CI);
                 }
                 return CI;