================ @@ -75,6 +75,25 @@ class TextTokenRetokenizer { return *Pos.BufferPtr; } + char peekNext(unsigned offset) const { + assert(!isEnd()); + assert(Pos.BufferPtr != Pos.BufferEnd); + if (Pos.BufferPtr + offset <= Pos.BufferEnd) { ---------------- sdkrystian wrote:
Shouldn't this be `if (Pos.BufferPtr + offset < Pos.BufferEnd)` (unless this depends of the buffer being null terminated)? Otherwise this allows for an `offset` which results in `Pos.BufferEnd` being read. https://github.com/llvm/llvm-project/pull/84726 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits