summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-10-14 23:51:43 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-10-14 23:51:43 +0000
commit0f8155ae4e2cb08bf52c94fec1c73393c16bc708 (patch)
tree2ca199903db827b9d7a4ebaabd1883b4ee4e485a /llvm/lib
parent389529a7dfd4346d6fb397845d403bb845e52e08 (diff)
downloadbcm5719-llvm-0f8155ae4e2cb08bf52c94fec1c73393c16bc708.tar.gz
bcm5719-llvm-0f8155ae4e2cb08bf52c94fec1c73393c16bc708.zip
Prevent assert when using '"' in names (via hexadecimal).
Update LangRef to mention \xx quoting in names. llvm-svn: 57538
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/VMCore/AsmWriter.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/AsmWriter.cpp b/llvm/lib/VMCore/AsmWriter.cpp
index ddcb8d6c0ab..0080d63b63a 100644
--- a/llvm/lib/VMCore/AsmWriter.cpp
+++ b/llvm/lib/VMCore/AsmWriter.cpp
@@ -112,10 +112,9 @@ static void PrintLLVMName(raw_ostream &OS, const char *NameStr,
OS << '"';
for (unsigned i = 0; i != NameLen; ++i) {
char C = NameStr[i];
- assert(C != '"' && "Illegal character in LLVM value name!");
if (C == '\\') {
OS << "\\\\";
- } else if (isprint(C)) {
+ } else if (C != '"' && isprint(C)) {
OS << C;
} else {
OS << '\\';
OpenPOWER on IntegriCloud