[PATCH] D44932: [CodeComplete] Fix completion in the middle of ident in ctor lists.

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Apr 21 01:44:59 PDT 2018


ilya-biryukov added inline comments.


================
Comment at: lib/Lex/Lexer.cpp:1667-1668
+      assert(CurPtr < BufferEnd && "eof at completion point");
+      while (isIdentifierBody(*CurPtr))
+        ++CurPtr;
+      BufferPtr = CurPtr;
----------------
aaron.ballman wrote:
> You should continue to assert that `CurPtr < BufferEnd` in this loop, no?
AFAIK, all buffers end with `'\0'`, so lexer usually loops without doing bound checking, e.g. a similar loop is at Lexer.cpp:1623.

It turned out the completion token is not added when completion point is at the end of the buffer, though, fixed that.


Repository:
  rC Clang

https://reviews.llvm.org/D44932





More information about the cfe-commits mailing list