This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Re:+libgcj/23
- To: java-patches@sourceware.cygnus.com, tromey@cygnus.com, green@cygnus.com
- Subject: Re:+libgcj/23
- From: Bryce McKinlay <bryce@albatross.co.nz>
- Date: Wed, 11 Aug 1999 21:47:29 +1200
This seems to be a bit-shifting overflow in BitSet.java (the "1"
constants are treated as int by default and need to be explicitly
specified as long).
Patch follows.
regards
[ bryce ]
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/util/BitSet.java,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 BitSet.java
--- BitSet.java 1999/04/07 14:52:41 1.1.1.1
+++ BitSet.java 1999/08/11 09:25:36
@@ -56,7 +56,7 @@
int bit = pos % 64;
int offset = pos / 64;
ensure (offset);
- bits[offset] &= ~ (1 << bit);
+ bits[offset] &= ~ (1L << bit);
}
public Object clone ()
@@ -97,7 +97,7 @@
if (offset >= bits.length)
return false;
- return (bits[offset] & (1 << bit)) == 0 ? false : true;
+ return (bits[offset] & (1L << bit)) == 0 ? false : true;
}
public int hashCode ()
@@ -125,7 +125,7 @@
int bit = pos % 64;
int offset = pos / 64;
ensure (offset);
- bits[offset] |= 1 << bit;
+ bits[offset] |= 1L << bit;
}
public int size ()