7006471: fix for 6988439 crashes when pending list lock is null

Tue, 14 Dec 2010 15:10:52 -0500

author
coleenp
date
Tue, 14 Dec 2010 15:10:52 -0500
changeset 2367
b03e6b4c7c75
parent 2366
06ba96862949
child 2368
e7ad5f6f4d29
child 2369
aa6e219afbf1
child 2391
1e637defdda6
child 2396
e0c969b97f66

7006471: fix for 6988439 crashes when pending list lock is null
Summary: missing null check in owns_pending_list_lock() because this can be called before pending_list_lock is initialized.
Reviewed-by: never, kvn

src/share/vm/oops/instanceRefKlass.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/oops/instanceRefKlass.cpp	Mon Dec 13 14:46:51 2010 -0800
     1.2 +++ b/src/share/vm/oops/instanceRefKlass.cpp	Tue Dec 14 15:10:52 2010 -0500
     1.3 @@ -458,6 +458,7 @@
     1.4  }
     1.5  
     1.6  bool instanceRefKlass::owns_pending_list_lock(JavaThread* thread) {
     1.7 +  if (java_lang_ref_Reference::pending_list_lock() == NULL) return false;
     1.8    Handle h_lock(thread, java_lang_ref_Reference::pending_list_lock());
     1.9    return ObjectSynchronizer::current_thread_holds_lock(thread, h_lock);
    1.10  }

mercurial