aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-17 23:03:14 +0000
committerChris Lattner <sabre@nondot.org>2008-04-17 23:03:14 +0000
commit9227c6953497be34281354f949d6f4cd34a696cc (patch)
tree4f1471fe049a82f9ce8e16eb5e53a831d946a1df
parent339b9c27759d7b6a53e2370f83f66e78b3254595 (diff)
Fix a problem noticed by Nuno, where we wouldn't escape characters in
macro expansions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49877 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Rewrite/HTMLRewrite.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Rewrite/HTMLRewrite.cpp b/lib/Rewrite/HTMLRewrite.cpp
index ced8e5e938..ddf6cbeba2 100644
--- a/lib/Rewrite/HTMLRewrite.cpp
+++ b/lib/Rewrite/HTMLRewrite.cpp
@@ -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());