Skip to content

Commit 8b21775

Browse files
authored
Merge pull request eclipse-openj9#20883 from luke-li-2003/JITServerHelperAssertFix
Account for Truncated Signatures in a JITServerHelpers Assertion
2 parents b0ab9a3 + bdc25ec commit 8b21775

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

runtime/compiler/control/JITServerHelpers.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,15 @@ packCallback(const J9ROMClass *romClass, const J9SRP *origSrp, const char *slotN
329329
if (dst == ctx._cursor)
330330
ctx._cursor += copyUTF8((J9UTF8 *)dst, str, it->second.second/*truncate*/ ? ctx._generatedPrefixLength : 0);
331331
else
332-
TR_ASSERT((dst < ctx._cursor) && (memcmp(dst, str, J9UTF8_TOTAL_SIZE(str)) == 0), "Must be already copied");
332+
TR_ASSERT(
333+
(dst < ctx._cursor) && (
334+
(it->second.second && (memcmp(utf8Data((J9UTF8 *) dst),
335+
utf8Data((J9UTF8 *) str),
336+
ctx._generatedPrefixLength) == 0)) ||
337+
(!it->second.second && (memcmp(dst, str, J9UTF8_TOTAL_SIZE(str)) == 0))
338+
),
339+
"Must be already copied"
340+
);
333341
}
334342

335343
static void

0 commit comments

Comments
 (0)