]> granicus.if.org Git - clang/commitdiff
Make sure to escape " when it occurs in a string in pragma comment
authorChris Lattner <sabre@nondot.org>
Fri, 16 Jan 2009 22:13:37 +0000 (22:13 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 16 Jan 2009 22:13:37 +0000 (22:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62367 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/PrintPreprocessedOutput.cpp

index 9fc37d9f51f1f668d9479456958c8dc8ad4be40a..64cc4c8be65bdcbaba8f39ac99f23cf8f69334c8 100644 (file)
@@ -209,7 +209,7 @@ void PrintPPOutputPPCallbacks::PragmaComment(SourceLocation Loc,
     
     for (unsigned i = 0, e = Str.size(); i != e; ++i) {
       unsigned char Char = Str[i];
-      if (isprint(Char) && Char != '\\')
+      if (isprint(Char) && Char != '\\' && Char != '"')
         OS << (char)Char;
       else  // Output anything hard as an octal escape.
         OS << '\\'