From: Ted Kremenek Date: Tue, 21 Jul 2009 21:16:46 +0000 (+0000) Subject: Patch by Stefan Bühler: Escape text in macro expansion when emitting HTML in the... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b83ded0db9824b3b0417bf46540ed34d48776673;p=clang Patch by Stefan Bühler: Escape text in macro expansion when emitting HTML in the HTMLRewriter. This fixes PR 4602. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76647 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Rewrite/HTMLRewrite.cpp b/lib/Rewrite/HTMLRewrite.cpp index 69dd03ad3f..34375fd48a 100644 --- a/lib/Rewrite/HTMLRewrite.cpp +++ b/lib/Rewrite/HTMLRewrite.cpp @@ -519,7 +519,7 @@ void html::HighlightMacros(Rewriter &R, FileID FID, Preprocessor& PP) { assert(SM.getFileID(LLoc.second) == FID && "Start and end of expansion must be in the same ultimate file!"); - std::string Expansion = PP.getSpelling(Tok); + std::string Expansion = EscapeText(PP.getSpelling(Tok)); unsigned LineLen = Expansion.size(); Token PrevTok = Tok;