re PR libgcj/12013 (Calling Reference.clear() can cause runtime to crash.)

2003-08-21  David Daney  <ddaney@avtrex.com>

	Fix for PR libgcj/12013:
	* java/lang/ref/natReference.cc (finalize_referred_to_object):
	Check `cleared' field.
	* java/lang/ref/Reference.java (copy): Updated comments.
	(cleared): New field.
	(clear): Rewrote.

From-SVN: r70668
This commit is contained in:
David Daney 2003-08-21 22:08:09 +00:00 committed by Tom Tromey
parent aa779cf369
commit c9a61d5aa7
3 changed files with 25 additions and 9 deletions

View file

@ -258,9 +258,7 @@ finalize_referred_to_object (jobject obj)
{
java::lang::ref::Reference *ref
= reinterpret_cast<java::lang::ref::Reference *> (head->reference);
// If the copy is already NULL then the user must have
// called Reference.clear().
if (ref->copy != NULL)
if (! ref->cleared)
ref->enqueue ();
object_list *next = head->next;