Skip to content

Commit

Permalink
Merge pull request #20883 from luke-li-2003/JITServerHelperAssertFix
Browse files Browse the repository at this point in the history
Account for Truncated Signatures in a JITServerHelpers Assertion
  • Loading branch information
mpirvu authored Jan 4, 2025
2 parents b0ab9a3 + bdc25ec commit 8b21775
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion runtime/compiler/control/JITServerHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,15 @@ packCallback(const J9ROMClass *romClass, const J9SRP *origSrp, const char *slotN
if (dst == ctx._cursor)
ctx._cursor += copyUTF8((J9UTF8 *)dst, str, it->second.second/*truncate*/ ? ctx._generatedPrefixLength : 0);
else
TR_ASSERT((dst < ctx._cursor) && (memcmp(dst, str, J9UTF8_TOTAL_SIZE(str)) == 0), "Must be already copied");
TR_ASSERT(
(dst < ctx._cursor) && (
(it->second.second && (memcmp(utf8Data((J9UTF8 *) dst),
utf8Data((J9UTF8 *) str),
ctx._generatedPrefixLength) == 0)) ||
(!it->second.second && (memcmp(dst, str, J9UTF8_TOTAL_SIZE(str)) == 0))
),
"Must be already copied"
);
}

static void
Expand Down

0 comments on commit 8b21775

Please sign in to comment.