Fix off-by-one error in PPCaching.cpp token annotation assertion
authorReid Kleckner <rnk@google.com>
Thu, 20 Oct 2016 20:53:20 +0000 (20:53 +0000)
committerReid Kleckner <rnk@google.com>
Thu, 20 Oct 2016 20:53:20 +0000 (20:53 +0000)
commitae818501b7d891512de45c1f7362045c53440a46
treecad98b7a755a9f4ea661ab2ebb1eb7c7ecc5b989
parent94dff2c0af5cd8bb3877e6defad76e6cec60d1e8
Fix off-by-one error in PPCaching.cpp token annotation assertion

This assert is intended to defend against backtracking into the middle
of a sequence of tokens that is being replaced with an annotation, but
it's OK if we backtrack to the exact position of the start of the
annotation sequence. Use a <= comparison instead of <.

Fixes PR25946

llvm-svn: 284777
clang/lib/Lex/PPCaching.cpp
clang/test/Parser/backtrack-off-by-one.cpp [new file with mode: 0644]