src/hotspot/share/gc/shared/collectedHeap.cpp
changeset 49468 bef5683e363d
parent 49466 6ce398fe53fd
child 49484 ee8fa73b90f9
--- 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) {