[clang] [Clang][Comments] Add argument parsing for @throw @throws @exception (PR #84726)

Krystian Stasiowski via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 27 03:30:48 PDT 2024


================
@@ -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


More information about the cfe-commits mailing list