On Thu, 3 Oct 2002 11:55:00 -0700 (PDT)
Dalibor Topic <[EMAIL PROTECTED]> wrote:

> Hi Kevin,
> 
> --- "Kevin D. Kissell" <[EMAIL PROTECTED]> wrote:
> > The new build from CVS (with my MIPS patch)
> > passes all the regression tests, including the new
> > CatchLimits.class.save test, but it fails the SPEC
> > JVM98 _200_check sanity check, on the 
> > testObjectArray test, blowing out with:
> > 
> > java.lang.ArrayStoreException: not arrays
> > 
> > This arose from an invocation of 
> > java.lang.system.arraycopy() by the SPEC code.
> > I'd provide the whole exception backtrace, but
> > the applet console window doesn't allow me to
> > cut and paste to an Xterm. :-(  I hope that this
> > clue would be enough to tell someone who had
> > made relevant mods between 1.0.7 and today
> > where they should re-check their work.
> 
> It was me who made the modification. I merged in the
> pure java System.arraycopy from pocketlinux as it was
> pure java and faster on small cases than the native
> method invocation. It made a noticeable difference on
> the SciMark benchmark.
> 
> In the new code, instanceof destination array is used
> to check the type of the array, and call the according
> copy loop. I assume that we are mishandling the case
> where destination is null, and the check fails for all
> types.
> 
> Could you confirm that by replacing the throw clause
> by a few System.err.println calls with dst and src in
> libraries/javalib/java/lang/System.java in method
> arraycopy? 

I guess the problem is that System.arraycopy
doesn't verify that dst and src are both !=
null before figuring out how to copy the array.

According to the api spec, System.arraycopy is
supposed to throw a NullPointerException when
either src or dst are null, so something like
the attached patch should make kaffe pass the
test.

Greetings,
Helmer

Attachment: java-lang-system.patch
Description: Binary data

Reply via email to