[clang] Fix clang crash when printing highlighted code in diagnostic (after #66514) (PR #80442)

via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 2 16:22:23 PST 2024


================
@@ -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,
----------------
alexfh wrote:

That's about as much as we can help with further debugging. As I said, I don't see how to create a reliable test case here.

https://github.com/llvm/llvm-project/pull/80442


More information about the cfe-commits mailing list