diff options
-rw-r--r-- | lib/Driver/ArgList.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Driver/ArgList.cpp b/lib/Driver/ArgList.cpp index e5341884ee..0d7b057c78 100644 --- a/lib/Driver/ArgList.cpp +++ b/lib/Driver/ArgList.cpp @@ -47,11 +47,11 @@ void ArgList::append(Arg *A) { } void ArgList::eraseArg(OptSpecifier Id) { - for (iterator it = begin(), ie = end(); it != ie; ++it) { + for (iterator it = begin(), ie = end(); it != ie; ) { if ((*it)->getOption().matches(Id)) { - Args.erase(it); - it = begin(); - ie = end(); + it = Args.erase(it); + } else { + ++it; } } } |