--- old/src/cpu/zero/vm/cppInterpreter_zero.cpp 2019-04-11 21:28:18.551982634 +0000 +++ new/src/cpu/zero/vm/cppInterpreter_zero.cpp 2019-04-11 21:28:18.451981998 +0000 @@ -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. * @@ -405,10 +405,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(result[0]); + istate->set_oop_temp(JNIHandles::resolve(handle)); + } } // Reset handle block