This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[BC] Patch: FYI: GC interface fixlet
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 25 Oct 2004 11:21:55 -0600
- Subject: [BC] Patch: FYI: GC interface fixlet
- Reply-to: tromey at redhat dot com
I'm checking this in on the BC branch.
I ran into a situation where we dereferenced the aux_info field even
though it was NULL. This is probably the result of a race where the
GC marks the class before it is fully initialized.
This patch lets us avoid the problem for now. The real fix is to
follow the plan in PR 18086. I'd like to try to do this before 4.0,
since it would be a big improvement in robustness, but I'm pretty busy
and it isn't clear if I'll get to it :-(
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* boehm.cc (_Jv_MarkObj): Test aux_info before dereferencing it.
Index: boehm.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/boehm.cc,v
retrieving revision 1.42.12.9
diff -u -r1.42.12.9 boehm.cc
--- boehm.cc 18 Oct 2004 20:27:11 -0000 1.42.12.9
+++ boehm.cc 25 Oct 2004 17:19:05 -0000
@@ -241,7 +241,7 @@
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c);
#ifdef INTERPRETER
- if (_Jv_IsInterpretedClass (c))
+ if (_Jv_IsInterpretedClass (c) && c->aux_info)
{
_Jv_InterpClass* ic = (_Jv_InterpClass*) c->aux_info;