3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-25 16:42:35 +00:00

Merge branch 'YosysHQ:main' into main

This commit is contained in:
Akash Levy 2025-03-14 18:07:55 -07:00 committed by GitHub
commit 1c0d4a43b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 147 additions and 10 deletions

View file

@ -634,10 +634,11 @@ std::string escape_cxx_string(const std::string &input)
output.push_back('\\');
output.push_back(c);
} else {
char l = c & 0xf, h = (c >> 4) & 0xf;
output.append("\\x");
output.push_back((h < 10 ? '0' + h : 'a' + h - 10));
output.push_back((l < 10 ? '0' + l : 'a' + l - 10));
char l = c & 0x7, m = (c >> 3) & 0x7, h = (c >> 6) & 0x3;
output.push_back('\\');
output.push_back('0' + h);
output.push_back('0' + m);
output.push_back('0' + l);
}
}
output.push_back('"');