1.1 --- a/src/cpu/zero/vm/cppInterpreter_zero.cpp Thu Nov 05 11:42:42 2015 +0100 1.2 +++ b/src/cpu/zero/vm/cppInterpreter_zero.cpp Tue May 07 20:38:26 2019 +0000 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. 1.7 * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. 1.8 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.9 * 1.10 @@ -405,10 +405,12 @@ 1.11 // oop_temp where the garbage collector can see it before 1.12 // we release the handle it might be protected by. 1.13 if (handler->result_type() == &ffi_type_pointer) { 1.14 - if (result[0]) 1.15 - istate->set_oop_temp(*(oop *) result[0]); 1.16 - else 1.17 + if (result[0] == 0) { 1.18 istate->set_oop_temp(NULL); 1.19 + } else { 1.20 + jobject handle = reinterpret_cast<jobject>(result[0]); 1.21 + istate->set_oop_temp(JNIHandles::resolve(handle)); 1.22 + } 1.23 } 1.24 1.25 // Reset handle block