[llvm] r217974 - Fixup for r217830. Don't do left shifts on negative values

Alexey Samsonov vonosmas at gmail.com
Wed Sep 17 11:23:07 PDT 2014


Author: samsonov
Date: Wed Sep 17 13:23:07 2014
New Revision: 217974

URL: http://llvm.org/viewvc/llvm-project?rev=217974&view=rev
Log:
Fixup for r217830. Don't do left shifts on negative values

Modified:
    llvm/trunk/include/llvm/Support/LEB128.h

Modified: llvm/trunk/include/llvm/Support/LEB128.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/LEB128.h?rev=217974&r1=217973&r2=217974&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/LEB128.h (original)
+++ llvm/trunk/include/llvm/Support/LEB128.h Wed Sep 17 13:23:07 2014
@@ -103,7 +103,7 @@ inline int64_t decodeSLEB128(const uint8
   } while (Byte >= 128);
   // Sign extend negative numbers.
   if (Byte & 0x40)
-    Value |= (-1LL) << Shift;
+    Value |= (-1ULL) << Shift;
   if (n)
     *n = (unsigned)(p - orig_p);
   return Value;





More information about the llvm-commits mailing list