Skip to content

Commit

Permalink
Merge pull request #16615 from ehrenjulzert/v0.36.1-release
Browse files Browse the repository at this point in the history
(0.36.1) Only call fixHiddenOrAnonSignature in Java 17+
  • Loading branch information
pshipton authored Jan 27, 2023
2 parents e68fb24 + ae6c27d commit 0592661
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion runtime/jvmti/jvmtiClass.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 1991, 2022 IBM Corp. and others
* Copyright (c) 1991, 2023 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -296,6 +296,7 @@ jvmtiGetClassLoaderClasses(jvmtiEnv* env,
}


#if JAVA_SPEC_VERSION >= 17
void fixHiddenOrAnonSignature(char* signature, UDATA signatureLength) {
if (signatureLength >= (ROM_ADDRESS_LENGTH + 2)) {
IDATA lastSeparatorIndex = signatureLength - (ROM_ADDRESS_LENGTH + 2);
Expand All @@ -309,6 +310,7 @@ void fixHiddenOrAnonSignature(char* signature, UDATA signatureLength) {
}
}
}
#endif /* JAVA_SPEC_VERSION >= 17 */


jvmtiError JNICALL
Expand Down Expand Up @@ -382,9 +384,11 @@ jvmtiGetClassSignature(jvmtiEnv* env,
memcpy(signature + arity + 1, J9UTF8_DATA(utf), utfLength);
signature[allocSize - 1] = ';';

#if JAVA_SPEC_VERSION >= 17
if (J9ROMCLASS_IS_ANON_OR_HIDDEN(leafType->romClass)) {
fixHiddenOrAnonSignature(signature, allocSize);
}
#endif /* JAVA_SPEC_VERSION >= 17 */
}
signature[allocSize] = '\0';
} else {
Expand All @@ -401,9 +405,11 @@ jvmtiGetClassSignature(jvmtiEnv* env,
signature[utfLength + 1] = ';';
signature[utfLength + 2] = '\0';

#if JAVA_SPEC_VERSION >= 17
if (J9ROMCLASS_IS_ANON_OR_HIDDEN(clazz->romClass)) {
fixHiddenOrAnonSignature(signature, utfLength + 2);
}
#endif /* JAVA_SPEC_VERSION >= 17 */
}
}

Expand Down

0 comments on commit 0592661

Please sign in to comment.