Skip to content

Commit

Permalink
Merge pull request #18585 from cjjdespres/walkfix
Browse files Browse the repository at this point in the history
Fix erroneously large section size in ROM walk
  • Loading branch information
babsingh authored Jan 10, 2024
2 parents 1cf0141 + 61c9a2b commit f66dfa2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions runtime/util/romclasswalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,12 @@ void allSlotsInROMClassDo(J9ROMClass* romClass,
#endif /* JAVA_SPEC_VERSION >= 11 */

/* add CP NAS section */
firstMethod = J9ROMCLASS_ROMMETHODS(romClass);
count = (U_32)(((UDATA)firstMethod - (UDATA)srpCursor) / (sizeof(J9SRP) * 2));
if (0 != romClass->romMethodCount) {
firstMethod = J9ROMCLASS_ROMMETHODS(romClass);
count = (U_32)(((UDATA)firstMethod - (UDATA)srpCursor) / (sizeof(J9SRP) * 2));
} else {
count = 0;
}
rangeValid = callbacks->validateRangeCallback(romClass, srpCursor, count * sizeof(J9SRP) * 2, userData);
if (rangeValid) {
callbacks->sectionCallback(romClass, srpCursor, count * sizeof(J9SRP) * 2, "cpNamesAndSignaturesSRPs", userData);
Expand Down

0 comments on commit f66dfa2

Please sign in to comment.