================
@@ -393,7 +393,7 @@ static bool isQuoteCppDigitSeparator(const char *const
Start,
}
void Scanner::skipLine(const char *&First, const char *const End) {
----------------
naveen-seth wrote:
My bad! The bug was introduced because I initialized `char LastNonWhitespace =
' ';` one scope too far out.
This can cause `LastNonWhitespace` to not be reset (it remains `'\'`), which
then results in an additional line being skipped.
To fix this bug, the only change needed is to move it one scope down, into the
for loop:
```cpp
void Scanner::skipLine(const char *&First, const char *const End) {
for (;;) {
assert(First <= End);
if (First == End)
return;
if (isVerticalWhitespace(*First)) {
skipNewline(First, End);
return;
}
const char *Start = First;
char LastNonWhitespace = ' ';
while (First != End && !isVerticalWhitespace(*First)) {
```
https://github.com/llvm/llvm-project/pull/146645
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits