Handle the removal of the debug chain.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26729 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index 501bd62..61b194a 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -1861,8 +1861,8 @@
   if (!upgradedFunctions.empty()) {
     for (Function::iterator BI = F->begin(), BE = F->end(); BI != BE; ++BI) 
       for (BasicBlock::iterator II = BI->begin(), IE = BI->end(); 
-           II != IE; ++II)
-        if (CallInst* CI = dyn_cast<CallInst>(II)) {
+           II != IE;)
+        if (CallInst* CI = dyn_cast<CallInst>(II++)) {
           std::map<Function*,Function*>::iterator FI = 
             upgradedFunctions.find(CI->getCalledFunction());
           if (FI != upgradedFunctions.end())