Prevent assert when using '"' in names (via hexadecimal).
[oota-llvm.git] / lib / VMCore / AsmWriter.cpp
index ddcb8d6c0abafe6680eb263aec84d1f3ac802a13..0080d63b63a0ce43d9e5403265f93204b21dd98e 100644 (file)
@@ -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 << '\\';