Get the order of the hext digits right!
authorReid Spencer <rspencer@reidspencer.com>
Sat, 19 May 2007 14:44:42 +0000 (14:44 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Sat, 19 May 2007 14:44:42 +0000 (14:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37261 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/AsmWriter.cpp

index b205ccc4ab4704e84d363d05399bd04b3ce6da8d..1d97d5c54f3f48695231da75229dc7bb87cae14c 100644 (file)
@@ -195,12 +195,12 @@ static std::string QuoteNameIfNeeded(const std::string &Name) {
     } else {
       needsQuotes = true;
       result += "\\";
-      char hex1 = C & 0x0F;
+      char hex1 = (C >> 4) & 0x0F;
       if (hex1 < 10)
         result += hex1 + '0';
       else 
         result += hex1 - 10 + 'A';
-      char hex2 = (C >> 4) & 0x0F;
+      char hex2 = C & 0x0F;
       if (hex2 < 10)
         result += hex2 + '0';
       else