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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4583 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Hildenbrandt 2002-11-06 21:40:23 +00:00
parent 6d608154d6
commit 088b472eed
2 changed files with 4 additions and 4 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 {

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 {