From 75d3226b5ef5e6d3eb2a554433be0d90781ebd0e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 20 Jan 2006 18:01:41 +0000 Subject: [PATCH] Don't use invalidated use_iterator's. This fixes a crash compiling povray git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25479 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/AutoUpgrade.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp index 26a9947d306..568d08ab7a0 100644 --- a/lib/VMCore/AutoUpgrade.cpp +++ b/lib/VMCore/AutoUpgrade.cpp @@ -166,8 +166,8 @@ Instruction* llvm::UpgradeIntrinsicCall(CallInst *CI) { bool llvm::UpgradeCallsToIntrinsic(Function* F) { if (Function* newF = UpgradeIntrinsicFunction(F)) { for (Value::use_iterator UI = F->use_begin(), UE = F->use_end(); - UI != UE; ++UI) { - if (CallInst* CI = dyn_cast(*UI)) { + UI != UE; UI) { + if (CallInst* CI = dyn_cast(*UI++)) { std::vector Oprnds; User::op_iterator OI = CI->op_begin(); ++OI;