diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-07-27 10:21:08 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-07-27 10:21:08 +0000 |
commit | b399696572b5c610e8b88574084f7982c715dc94 (patch) | |
tree | abdf5c47b91adbc556ef70c8200dbdf7a8ca59c6 /lib/Sema/SemaLookup.cpp | |
parent | 11abf2ad01f64ede7c0555167f41a1c5852f80c6 (diff) |
Fix PR13394: Erasing from a vector changes the end of the vector, so make sure we always have the right end.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160855 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLookup.cpp')
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index e280705449..dad196b410 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -3895,13 +3895,13 @@ TypoCorrection Sema::CorrectTypo(const DeclarationNameInfo &TypoName, // If a validator callback object was given, drop the correction // unless it passes validation. bool Viable = false; - for (TypoResultList::iterator RI = I->second.begin(), RIEnd = I->second.end(); - RI != RIEnd; /* Increment in loop. */) { + for (TypoResultList::iterator RI = I->second.begin(); + RI != I->second.end(); /* Increment in loop. */) { TypoResultList::iterator Prev = RI; ++RI; if (Prev->isResolved()) { if (!isCandidateViable(CCC, *Prev)) - I->second.erase(Prev); + RI = I->second.erase(Prev); else Viable = true; } |