From 9dfb11d32d302abfe8803d530138b38ddc567c60 Mon Sep 17 00:00:00 2001 From: David Greene Date: Mon, 17 Dec 2007 17:42:03 +0000 Subject: [PATCH] GLIBCXX_DEBUG fix. std::vector<>::end() is invalidated by erase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45101 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Utils/LowerSwitch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Utils/LowerSwitch.cpp b/lib/Transforms/Utils/LowerSwitch.cpp index dbf3f65d929..42732ebe550 100644 --- a/lib/Transforms/Utils/LowerSwitch.cpp +++ b/lib/Transforms/Utils/LowerSwitch.cpp @@ -248,7 +248,7 @@ unsigned LowerSwitch::Clusterify(CaseVector& Cases, SwitchInst *SI) { // Merge case into clusters if (Cases.size()>=2) - for (CaseItr I=Cases.begin(), J=next(Cases.begin()), E=Cases.end(); J!=E; ) { + for (CaseItr I=Cases.begin(), J=next(Cases.begin()); J!=Cases.end(); ) { int64_t nextValue = cast(J->Low)->getSExtValue(); int64_t currentValue = cast(I->High)->getSExtValue(); BasicBlock* nextBB = J->BB;