]> granicus.if.org Git - clang/commitdiff
Fix a problem noticed by Nuno, where we wouldn't escape characters in
authorChris Lattner <sabre@nondot.org>
Thu, 17 Apr 2008 23:03:14 +0000 (23:03 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 17 Apr 2008 23:03:14 +0000 (23:03 +0000)
macro expansions.

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

lib/Rewrite/HTMLRewrite.cpp

index ced8e5e9382ddb308ae30edbe09e3b8fca13eeec..ddf6cbeba20e9caf2b99abbb15ad754b6f6dfa8c 100644 (file)
@@ -451,11 +451,12 @@ void html::HighlightMacros(Rewriter &R, unsigned FileID,
       }
       
       LineLen -= Expansion.size();
-      Expansion += ' ' + PP->getSpelling(Tok);
+      // Escape any special characters in the token text.
+      Expansion += ' ' + EscapeText(PP->getSpelling(Tok));
       LineLen += Expansion.size();
       PP->Lex(Tok);
     }
-
+    
     // Insert the information about the expansion inside the macro span.
     Expansion = "<span class='expansion'>" + Expansion + "</span>";
     RB.InsertTextBefore(TokOffs+TokLen, Expansion.c_str(), Expansion.size());