re PR libgcj/23353 (clone() copies internal lock data with hash synchronization off)

2005-08-12  Morgan Deters  <mdeters@morgandeters.com>

	PR libgcj/23353:
	* java/lang/natObject.cc (clone): Clear sync_info.

From-SVN: r103039
This commit is contained in:
Morgan Deters 2005-08-12 16:40:32 +00:00 committed by Tom Tromey
parent 2693c0b0b3
commit 25c76a15f7
2 changed files with 11 additions and 1 deletions

View file

@ -1,6 +1,6 @@
// natObject.cc - Implementation of the Object class.
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation
/* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005 Free Software Foundation
This file is part of libgcj.
@ -104,6 +104,11 @@ java::lang::Object::clone (void)
}
memcpy ((void *) r, (void *) this, size);
#ifndef JV_HASH_SYNCHRONIZATION
// Guarantee that the locks associated to the two objects are
// distinct.
r->sync_info = NULL;
#endif
return r;
}