diff --git a/runtime/vm/resolvesupport.cpp b/runtime/vm/resolvesupport.cpp index ae8e7ea2d3a..1f498da2a65 100644 --- a/runtime/vm/resolvesupport.cpp +++ b/runtime/vm/resolvesupport.cpp @@ -1174,14 +1174,15 @@ resolveSpecialMethodRefInto(J9VMThread *vmStruct, J9ConstantPool *ramCP, UDATA c J9JavaVM *vm = vmStruct->javaVM; if (vm->runtimeFlags & J9_RUNTIME_VERIFY) { J9Class *selectedMethodClass = J9_CLASS_FROM_METHOD(method); - J9ClassLoader * cl1 = resolvedMethodClass->classLoader; + J9ClassLoader * cl1 = currentClass->classLoader; J9ClassLoader * cl2 = selectedMethodClass->classLoader; if (cl1 != cl2) { J9UTF8 *signature = J9ROMNAMEANDSIGNATURE_SIGNATURE(nameAndSig); - if (0 != j9bcv_checkClassLoadingConstraintsForSignature(vmStruct, cl1, cl2, signature, signature)) { + J9UTF8 *selectedSig = J9ROMMETHOD_SIGNATURE(J9_ROM_METHOD_FROM_RAM_METHOD(method)); + if (0 != j9bcv_checkClassLoadingConstraintsForSignature(vmStruct, cl1, cl2, signature, selectedSig)) { if (0 == jitFlags) { J9UTF8 *name = J9ROMNAMEANDSIGNATURE_NAME(nameAndSig); - setClassLoadingConstraintSignatureError(vmStruct, cl1, resolvedMethodClass, cl2, selectedMethodClass, resolvedMethodClass, J9UTF8_DATA(name), J9UTF8_LENGTH(name), J9UTF8_DATA(signature), J9UTF8_LENGTH(signature)); + setClassLoadingConstraintSignatureError(vmStruct, cl1, currentClass, cl2, selectedMethodClass, resolvedMethodClass, J9UTF8_DATA(name), J9UTF8_LENGTH(name), J9UTF8_DATA(signature), J9UTF8_LENGTH(signature)); } method = NULL; goto done;