projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0b797b1
)
fix segfault (because of erasing after the vector boundaries) when the cached token...
author
Nuno Lopes
<nunoplopes@sapo.pt>
Sun, 26 Jul 2009 16:36:45 +0000
(16:36 +0000)
committer
Nuno Lopes
<nunoplopes@sapo.pt>
Sun, 26 Jul 2009 16:36:45 +0000
(16:36 +0000)
llvm-svn: 77159
clang/lib/Lex/PPCaching.cpp
patch
|
blob
|
history
diff --git
a/clang/lib/Lex/PPCaching.cpp
b/clang/lib/Lex/PPCaching.cpp
index
53aa09c
..
8087878
100644
(file)
--- a/
clang/lib/Lex/PPCaching.cpp
+++ b/
clang/lib/Lex/PPCaching.cpp
@@
-102,7
+102,8
@@
void Preprocessor::AnnotatePreviousCachedTokens(const Token &Tok) {
assert((BacktrackPositions.empty() || BacktrackPositions.back() < i) &&
"The backtrack pos points inside the annotated tokens!");
// Replace the cached tokens with the single annotation token.
- CachedTokens.erase(AnnotBegin + 1, CachedTokens.begin() + CachedLexPos);
+ if (i < CachedLexPos)
+ CachedTokens.erase(AnnotBegin + 1, CachedTokens.begin() + CachedLexPos);
*AnnotBegin = Tok;
CachedLexPos = i;
return;