Fix regression introduced by r83894.
authorBob Wilson <bob.wilson@apple.com>
Tue, 13 Oct 2009 17:29:13 +0000 (17:29 +0000)
committerBob Wilson <bob.wilson@apple.com>
Tue, 13 Oct 2009 17:29:13 +0000 (17:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83982 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMConstantIslandPass.cpp

index d9d7763eda2766de467ba45003ab69b195a8f765..309e3ba2ac251e444e455c81dc309f6a4bac2ff6 100644 (file)
@@ -933,13 +933,14 @@ static inline unsigned getUnconditionalBrDisp(int Opc) {
 ///
 MachineBasicBlock *ARMConstantIslands::AcceptWater(water_iterator IP) {
   DEBUG(errs() << "found water in range\n");
+  MachineBasicBlock *WaterBB = *IP;
   // Remove the original WaterList entry; we want subsequent
   // insertions in this vicinity to go after the one we're
   // about to insert.  This considerably reduces the number
   // of times we have to move the same CPE more than once.
   WaterList.erase(IP);
   // CPE goes before following block (NewMBB).
-  return next(MachineFunction::iterator(*IP));
+  return next(MachineFunction::iterator(WaterBB));
 }
 
 /// LookForWater - look for an existing entry in the WaterList in which