]> granicus.if.org Git - clang/commitdiff
[driver] Make sure to update the iterator end when erasing for Args.
authorChad Rosier <mcrosier@apple.com>
Fri, 12 Aug 2011 23:38:19 +0000 (23:38 +0000)
committerChad Rosier <mcrosier@apple.com>
Fri, 12 Aug 2011 23:38:19 +0000 (23:38 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137539 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/ArgList.cpp

index 0d7b057c78cf973febbedc368a4643c1579ca85a..c76356ca20ba38c1c12d26618522c19bc9935e07 100644 (file)
@@ -50,9 +50,9 @@ void ArgList::eraseArg(OptSpecifier Id) {
   for (iterator it = begin(), ie = end(); it != ie; ) {
     if ((*it)->getOption().matches(Id)) {
       it = Args.erase(it);
-    } else {
+      ie = end();
+    } else
       ++it;
-    }
   }
 }