fix order of operations regression in referenceTargetUnreachable

We need to dereference the GcJreference** before we change what it
points to.  The code was mistakenly reordered in the recent type
refactoring.
This commit is contained in:
Joel Dice 2014-07-17 17:53:36 -06:00
parent 84ad3c2392
commit 4c8f3933f5

View File

@ -409,11 +409,11 @@ void referenceTargetUnreachable(Thread* t, Heap::Visitor* v, GcJreference** p)
(*p)->target() = 0;
if (objectClass(t, *p) == type(t, GcCleaner::Type)) {
*p = cast<GcJreference>(t, (*p)->vmNext());
// In openjdk, sun/misc/Cleaner extends PhantomReference
GcCleaner* cleaner = (*p)->as<GcCleaner>(t);
*p = cast<GcJreference>(t, (*p)->vmNext());
cleaner->setQueueNext(t, roots(t)->objectsToClean());
roots(t)->setObjectsToClean(t, cleaner);
} else {