This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug libgcj/35979] JNI method NewStringUTF crashes when passed a NULL pointer
- From: "thomas dot g dot girard at free dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 19 Apr 2008 20:54:16 -0000
- Subject: [Bug libgcj/35979] JNI method NewStringUTF crashes when passed a NULL pointer
- References: <bug-35979-12997@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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