hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
changeset 43964 2f5e556a6037
parent 40655 9f644073d3a0
child 43969 ae5c415036b0
--- a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp	Wed Feb 15 17:26:37 2017 -0800
+++ b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp	Wed Feb 15 22:19:13 2017 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
@@ -406,10 +406,12 @@
   // oop_temp where the garbage collector can see it before
   // we release the handle it might be protected by.
   if (handler->result_type() == &ffi_type_pointer) {
-    if (result[0])
-      istate->set_oop_temp(*(oop *) result[0]);
-    else
+    if (result[0] == 0) {
       istate->set_oop_temp(NULL);
+    } else {
+      jobject handle = reinterpret_cast<jobject>(result[0]);
+      istate->set_oop_temp(JNIHandles::resolve(handle));
+    }
   }
 
   // Reset handle block