[Bug libgcj/35979] JNI method NewStringUTF crashes when passed a NULL pointer

thomas dot g dot girard at free dot fr gcc-bugzilla@gcc.gnu.org
Sat Apr 19 20:54:00 GMT 2008



------- Comment #3 from thomas dot g dot girard at free dot fr  2008-04-19 20:54 -------
You are absolutely right, thanks for pointing this out. The SIGSEGV gets
converted to an NPE.

But Sun's implementation does not throw an NPE. Please have a look at the
attached testcase. You can launch it using 'make JAVA=/path/to/sun/vm' to use a
different VM.

Outputs: 'Got: null' with Sun's VM, and 'Got: java.lang.NullPointerException'
with gij.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35979



More information about the Java-prs mailing list