Skip to content

Commit 0592661

Browse files
authored
Merge pull request #16615 from ehrenjulzert/v0.36.1-release
(0.36.1) Only call fixHiddenOrAnonSignature in Java 17+
2 parents e68fb24 + ae6c27d commit 0592661

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

runtime/jvmti/jvmtiClass.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 1991, 2022 IBM Corp. and others
2+
* Copyright (c) 1991, 2023 IBM Corp. and others
33
*
44
* This program and the accompanying materials are made available under
55
* the terms of the Eclipse Public License 2.0 which accompanies this
@@ -296,6 +296,7 @@ jvmtiGetClassLoaderClasses(jvmtiEnv* env,
296296
}
297297

298298

299+
#if JAVA_SPEC_VERSION >= 17
299300
void fixHiddenOrAnonSignature(char* signature, UDATA signatureLength) {
300301
if (signatureLength >= (ROM_ADDRESS_LENGTH + 2)) {
301302
IDATA lastSeparatorIndex = signatureLength - (ROM_ADDRESS_LENGTH + 2);
@@ -309,6 +310,7 @@ void fixHiddenOrAnonSignature(char* signature, UDATA signatureLength) {
309310
}
310311
}
311312
}
313+
#endif /* JAVA_SPEC_VERSION >= 17 */
312314

313315

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

387+
#if JAVA_SPEC_VERSION >= 17
385388
if (J9ROMCLASS_IS_ANON_OR_HIDDEN(leafType->romClass)) {
386389
fixHiddenOrAnonSignature(signature, allocSize);
387390
}
391+
#endif /* JAVA_SPEC_VERSION >= 17 */
388392
}
389393
signature[allocSize] = '\0';
390394
} else {
@@ -401,9 +405,11 @@ jvmtiGetClassSignature(jvmtiEnv* env,
401405
signature[utfLength + 1] = ';';
402406
signature[utfLength + 2] = '\0';
403407

408+
#if JAVA_SPEC_VERSION >= 17
404409
if (J9ROMCLASS_IS_ANON_OR_HIDDEN(clazz->romClass)) {
405410
fixHiddenOrAnonSignature(signature, utfLength + 2);
406411
}
412+
#endif /* JAVA_SPEC_VERSION >= 17 */
407413
}
408414
}
409415

0 commit comments

Comments
 (0)