From: Chris Lattner Date: Fri, 16 Jan 2009 22:13:37 +0000 (+0000) Subject: Make sure to escape " when it occurs in a string in pragma comment X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52a3e9ed658859606544bbdf5f5d1c3b89471820;p=clang Make sure to escape " when it occurs in a string in pragma comment git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62367 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Driver/PrintPreprocessedOutput.cpp b/Driver/PrintPreprocessedOutput.cpp index 9fc37d9f51..64cc4c8be6 100644 --- a/Driver/PrintPreprocessedOutput.cpp +++ b/Driver/PrintPreprocessedOutput.cpp @@ -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 << '\\'