8199886: gc/cslocker/TestCSLocker.java crashes
authorpliden
Tue, 20 Mar 2018 22:22:02 +0100
changeset 49468 bef5683e363d
parent 49467 74db2b7cec75
child 49469 1708db7f94c6
8199886: gc/cslocker/TestCSLocker.java crashes Reviewed-by: rkennke, kbarrett
src/hotspot/share/gc/shared/collectedHeap.cpp
--- a/src/hotspot/share/gc/shared/collectedHeap.cpp	Tue Mar 20 10:23:14 2018 -0700
+++ b/src/hotspot/share/gc/shared/collectedHeap.cpp	Tue Mar 20 22:22:02 2018 +0100
@@ -587,8 +587,9 @@
 }
 
 oop CollectedHeap::pin_object(JavaThread* thread, oop o) {
+  Handle handle(thread, o);
   GCLocker::lock_critical(thread);
-  return o;
+  return handle();
 }
 
 void CollectedHeap::unpin_object(JavaThread* thread, oop o) {