mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-12 01:25:49 +00:00
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:
@@ -297,8 +297,8 @@ void CWriter::printConstantArray(ConstantArray *CPA) {
|
|||||||
(unsigned char)cast<ConstantUInt>(CPA->getOperand(i))->getValue();
|
(unsigned char)cast<ConstantUInt>(CPA->getOperand(i))->getValue();
|
||||||
|
|
||||||
if (isprint(C)) {
|
if (isprint(C)) {
|
||||||
if (C == '"')
|
if (C == '"' || C == '\\')
|
||||||
Out << "\\\"";
|
Out << "\\" << C;
|
||||||
else
|
else
|
||||||
Out << C;
|
Out << C;
|
||||||
} else {
|
} else {
|
||||||
|
@@ -297,8 +297,8 @@ void CWriter::printConstantArray(ConstantArray *CPA) {
|
|||||||
(unsigned char)cast<ConstantUInt>(CPA->getOperand(i))->getValue();
|
(unsigned char)cast<ConstantUInt>(CPA->getOperand(i))->getValue();
|
||||||
|
|
||||||
if (isprint(C)) {
|
if (isprint(C)) {
|
||||||
if (C == '"')
|
if (C == '"' || C == '\\')
|
||||||
Out << "\\\"";
|
Out << "\\" << C;
|
||||||
else
|
else
|
||||||
Out << C;
|
Out << C;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user