From: Michael Koch Date: Fri, 9 Jul 2004 15:37:31 +0000 (+0000) Subject: ObjectInputStream.java (readFields): Use long datatype when shifting byte values... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3d5f053c02458ada47230963765efe2e09032f53;p=gcc.git ObjectInputStream.java (readFields): Use long datatype when shifting byte values more then 24 bits left. 2004-07-09 Michael Koch * java/io/ObjectInputStream.java (readFields): Use long datatype when shifting byte values more then 24 bits left. From-SVN: r84382 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index d78d2734db7..b7eea9697b9 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,8 @@ +2004-07-09 Michael Koch + + * java/io/ObjectInputStream.java (readFields): Use long datatype + when shifting byte values more then 24 bits left. + 2004-07-09 Michael Koch * java/util/zip/DeflaterOutputStream.java, diff --git a/libjava/java/io/ObjectInputStream.java b/libjava/java/io/ObjectInputStream.java index 292f841a657..809e9b1c941 100644 --- a/libjava/java/io/ObjectInputStream.java +++ b/libjava/java/io/ObjectInputStream.java @@ -1332,10 +1332,10 @@ public class ObjectInputStream extends InputStream int off = field.getOffset(); - return (long)(((prim_field_data[off++] & 0xFF) << 56) - | ((prim_field_data[off++] & 0xFF) << 48) - | ((prim_field_data[off++] & 0xFF) << 40) - | ((prim_field_data[off++] & 0xFF) << 32) + return (long)(((prim_field_data[off++] & 0xFFL) << 56) + | ((prim_field_data[off++] & 0xFFL) << 48) + | ((prim_field_data[off++] & 0xFFL) << 40) + | ((prim_field_data[off++] & 0xFFL) << 32) | ((prim_field_data[off++] & 0xFF) << 24) | ((prim_field_data[off++] & 0xFF) << 16) | ((prim_field_data[off++] & 0xFF) << 8) @@ -1369,10 +1369,10 @@ public class ObjectInputStream extends InputStream int off = field.getOffset(); return Double.longBitsToDouble - ( (long) (((prim_field_data[off++] & 0xFF) << 56) - | ((prim_field_data[off++] & 0xFF) << 48) - | ((prim_field_data[off++] & 0xFF) << 40) - | ((prim_field_data[off++] & 0xFF) << 32) + ( (long) (((prim_field_data[off++] & 0xFFL) << 56) + | ((prim_field_data[off++] & 0xFFL) << 48) + | ((prim_field_data[off++] & 0xFFL) << 40) + | ((prim_field_data[off++] & 0xFFL) << 32) | ((prim_field_data[off++] & 0xFF) << 24) | ((prim_field_data[off++] & 0xFF) << 16) | ((prim_field_data[off++] & 0xFF) << 8)