Fixes escapeing bug in strings. Fixes test case test/Regression/CBackend/2002-11-06-PrintEscaped.c

llvm-svn: 4583
This commit is contained in:
Nick Hildenbrandt 2002-11-06 21:40:23 +00:00
parent 36053f5b52
commit 642f44fe8e
1 changed files with 2 additions and 2 deletions

View File

@ -297,8 +297,8 @@ void CWriter::printConstantArray(ConstantArray *CPA) {
(unsigned char)cast<ConstantUInt>(CPA->getOperand(i))->getValue();
if (isprint(C)) {
if (C == '"')
Out << "\\\"";
if (C == '"' || C == '\\')
Out << "\\" << C;
else
Out << C;
} else {