================ @@ -1349,7 +1349,7 @@ void TextDiagnostic::emitSnippetAndCaret( // Prepare source highlighting information for the lines we're about to // emit, starting from the first line. std::unique_ptr<SmallVector<StyleRange>[]> SourceStyles = - highlightLines(BufStart, Lines.first, Lines.second, PP, LangOpts, + highlightLines(BufData, Lines.first, Lines.second, PP, LangOpts, ---------------- AaronBallman wrote:
Thank you for the debugging help! You're right, the scratch buffer does embed null characters: https://github.com/llvm/llvm-project/blob/ae354c5a45d319b3117c2822b8f6988461f3cb33/clang/lib/Lex/ScratchBuffer.cpp#L62 That gets used for the stringify operator (`#`) as well as for the `__DATE__` and `__TIME__` predefined macros, and the `_Pragma` operator; hopefully that helps @tbaederr to find a way to add test coverage for this so we don't accidentally regress it in the future. https://github.com/llvm/llvm-project/pull/80442 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits