diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp index 9e046633328d7..32e2b8cdcf4c6 100644 --- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp @@ -306,7 +306,7 @@ bool PrintPPOutputPPCallbacks::MoveToLine(unsigned LineNo, *OS << '\n'; StartedNewLine = true; } else if (!DisableLineMarkers) { - if (LineNo - CurLine <= 8) { + if (LineNo >= CurLine && LineNo - CurLine <= 8) { const char *NewLines = "\n\n\n\n\n\n\n\n"; OS->write(NewLines, LineNo - CurLine); } else {