BigInteger compile fails

Warren Levy warrenl@cygnus.com
Sat Apr 1 00:00:00 GMT 2000


On Mon, 14 Feb 2000, Matt Welsh wrote:

> > Either the latest egcs, or 2.95.2 with Bryce's compatibility patch.
> 
> I was using Bryce's patch. There must be something else wrong with 2.95.2
> then?

There's an easy workaround in the BigInteger source code.  If you can't find 
the right compiler fix, go ahead and apply this in the meantime.
--warrenl


--- BigInteger.java	Mon Feb 14 02:01:31 2000
+++ BigInteger.java.workaround	Tue Feb 15 15:29:14 2000
@@ -279,7 +279,10 @@ public class BigInteger extends Number i
 
   private final boolean isNegative()
   {
-    return (words == null ? ival : words[ival - 1]) < 0;
+    // FIXME: compiler error in egcs-19991214 when compiling to bytecode (only).
+    // return (words == null ? ival : words[ival - 1]) < 0;
+    int tmp = (words == null ? ival : words[ival - 1]);
+    return tmp < 0;
   }
 
   public int signum()


More information about the Java mailing list