This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gij runs HelloWorld on PPC Linux
- To: Mark Wielaard <mark at klomp dot org>
- Subject: Re: gij runs HelloWorld on PPC Linux
- From: jeff dot sturm at appnet dot com
- Date: Sun, 11 Feb 2001 16:05:47 -0500 (EST)
- cc: "Kevin B . Hendricks" <khendricks at ivey dot uwo dot ca>, Tom Tromey <tromey at redhat dot com>, java at gcc dot gnu dot org
On Sun, 11 Feb 2001, Mark Wielaard wrote:
> > gij Final
> >
> > (this returns the string "this should not happen" which is incorrect)
> Same here:
> $ gij Final
> This should not happen
>
> > gij Primes
> >
> > (this seems to run in an infinite loop never printing any Primes)
> Although this class takes a while (more then 30 seconds) it does
> print primes and finishes eventually. (output attached)
Those results match mine on Alpha. The erroneous Final output is caused
by a bug in the interpreter. One possible fix is:
Index: interpret.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/interpret.cc,v
retrieving revision 1.22
diff -u -r1.22 interpret.cc
--- interpret.cc 2000/10/20 23:25:57 1.22
+++ interpret.cc 2001/02/11 21:00:08
@@ -684,7 +684,10 @@
{
// final methods do not appear in the vtable,
// if it does not appear in the superclass.
- fun = (void (*)()) rmeth->method->ncode;
+ if (sp[0].o)
+ fun = (void (*)()) rmeth->method->ncode;
+ else
+ throw new ::java::lang::NullPointerException;
}
else
{