Bug 1253877 - Baldr: cast -1 to uint8 to avoid 'shifting negative' error on CLOSED TREE (r=bustage)
authorLuke Wagner <luke@mozilla.com>
Mon, 07 Mar 2016 09:56:34 -0600
changeset 324977 56aed3cbc3c09d7261ac61c77216973f7a04982a
parent 324976 c2b008a0c7ccb608b0248ed5d1ec711184cf22a0
child 324978 8c291729d042616f5c52619134e38a3e5e004a0a
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
bugs1253877
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1253877 - Baldr: cast -1 to uint8 to avoid 'shifting negative' error on CLOSED TREE (r=bustage) MozReview-Commit-ID: 8CYGVBxTpsg
js/src/asmjs/WasmBinary.h
--- a/js/src/asmjs/WasmBinary.h
+++ b/js/src/asmjs/WasmBinary.h
@@ -615,17 +615,17 @@ class Decoder
                 if (byte & 0x40)
                     s |= SInt(-1) << shift;
                 *out = s;
                 return true;
             }
         } while (shift < numBitsInSevens);
         if (!remainderBits || !readFixedU8(&byte) || (byte & 0x80))
             return false;
-        uint8_t mask = 0x7f & (-1 << remainderBits);
+        uint8_t mask = 0x7f & (uint8_t(-1) << remainderBits);
         if ((byte & mask) != ((byte & (1 << (remainderBits - 1))) ? mask : 0))
             return false;
         *out = s | SInt(byte) << shift;
         return true;
     }
 
   public:
     Decoder(const uint8_t* begin, const uint8_t* end)