[cfe-commits] r163007 - /cfe/trunk/lib/ARCMigrate/ARCMT.cpp

Joao Matos ripzonetriton at gmail.com
Fri Aug 31 10:28:10 PDT 2012


Author: triton
Date: Fri Aug 31 12:28:09 2012
New Revision: 163007

URL: http://llvm.org/viewvc/llvm-project?rev=163007&view=rev
Log:
Fixed invalid iterators. Since the iterator is invalidated after the erase() call, we need to replace it with the new one returned. This was triggering an assert under MSVC 2012 and making all the ARCMT/ tests fail.

Modified:
    cfe/trunk/lib/ARCMigrate/ARCMT.cpp

Modified: cfe/trunk/lib/ARCMigrate/ARCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ARCMT.cpp?rev=163007&r1=163006&r2=163007&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ARCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ARCMT.cpp Fri Aug 31 12:28:09 2012
@@ -42,7 +42,7 @@
       while (I != List.end() && I->getLevel() == DiagnosticsEngine::Note)
         ++I;
       // Clear the diagnostic and any notes following it.
-      List.erase(eraseS, I);
+      I = List.erase(eraseS, I);
       continue;
     }
 





More information about the cfe-commits mailing list