OSDN Git Service

Return unsigned shorts in ShortArrayCodeInput.
authorJesse Wilson <jessewilson@google.com>
Fri, 18 Feb 2011 03:16:28 +0000 (19:16 -0800)
committerJesse Wilson <jessewilson@google.com>
Fri, 18 Feb 2011 03:16:28 +0000 (19:16 -0800)
Follow up to I9a77541b994f184da0e389840e5cac728ad6c072
http://b/3447216

Change-Id: I0746ab58aa765d83274931a95ecea0b56c3581d7

dx/src/com/android/dx/io/instructions/ShortArrayCodeInput.java

index 03897c9..49ce473 100644 (file)
@@ -47,7 +47,7 @@ public final class ShortArrayCodeInput extends BaseCodeCursor
         try {
             int value = array[cursor()];
             advance(1);
-            return value;
+            return value & 0xffff;
         } catch (ArrayIndexOutOfBoundsException ex) {
             throw new EOFException();
         }
@@ -55,18 +55,18 @@ public final class ShortArrayCodeInput extends BaseCodeCursor
 
     /** @inheritDoc */
     public int readInt() throws EOFException {
-        int short0 = read() & 0xffff;
-        int short1 = read() & 0xffff;
+        int short0 = read();
+        int short1 = read();
 
         return short0 | (short1 << 16);
     }
 
     /** @inheritDoc */
     public long readLong() throws EOFException {
-        long short0 = read() & 0xffff;
-        long short1 = read() & 0xffff;
-        long short2 = read() & 0xffff;
-        long short3 = read() & 0xffff;
+        long short0 = read();
+        long short1 = read();
+        long short2 = read();
+        long short3 = read();
 
         return short0 | (short1 << 16) | (short2 << 32) | (short3 << 48);
     }