]> granicus.if.org Git - clang/commitdiff
Patch by Stefan Bühler: Escape text in macro expansion when emitting HTML in the...
authorTed Kremenek <kremenek@apple.com>
Tue, 21 Jul 2009 21:16:46 +0000 (21:16 +0000)
committerTed Kremenek <kremenek@apple.com>
Tue, 21 Jul 2009 21:16:46 +0000 (21:16 +0000)
This fixes PR 4602.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76647 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Rewrite/HTMLRewrite.cpp

index 69dd03ad3f1f71132782bd3ea3f2c5f9d5cf2852..34375fd48a64638ae275038e249cfd9745205acf 100644 (file)
@@ -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;