This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: jni fixlet
- From: Tom Tromey <tromey at redhat dot com>
- To: Marco Trudel <mtrudel at gmx dot ch>
- Cc: David Daney <ddaney at avtrex dot com>, Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 07 Feb 2007 13:32:34 -0700
- Subject: Re: jni fixlet
- References: <45C24A32.8060807@gmx.ch> <45C24E56.6020605@avtrex.com> <45C251DF.6060107@gmx.ch>
- Reply-to: tromey at redhat dot com
>>>>> "Marco" == Marco Trudel <mtrudel@gmx.ch> writes:
Marco> Attached the version with the comment on the second line.
A few formatting nits... it is a little more usual not to put comments
on the same line as code (except for something like a table). Also
there is a space between 'if' and '('. Finally ChangeLog entries have
a precise formatting, including a tab before the '*'.
It is a little silly that a 3 line patch can result in so much
conversation. But, that's GCC for you :-}
Here's what I'm checking in.
Do you know whether we need this for local refs as well?
Tom
Index: ChangeLog
from Marco Trudel <mtrudel@gmx.ch>
* jni.cc (_Jv_JNI_DeleteWeakGlobalRef): Check for NULL objects.
Index: jni.cc
===================================================================
--- jni.cc (revision 121691)
+++ jni.cc (working copy)
@@ -1750,6 +1750,10 @@
void JNICALL
_Jv_JNI_DeleteWeakGlobalRef (JNIEnv *, jweak obj)
{
+ // JDK compatibility.
+ if (obj == NULL)
+ return;
+
using namespace gnu::gcj::runtime;
JNIWeakRef *ref = reinterpret_cast<JNIWeakRef *> (obj);
unmark_for_gc (ref, global_ref_table);