From 72d0c4bc85e8db034fc08ce273eb81c516f5bcc3 Mon Sep 17 00:00:00 2001 From: zaryabzip <110787259+zaryabzip@users.noreply.github.com> Date: Sat, 31 Oct 2026 04:31:24 +0500 Subject: [PATCH] test(libSceNpScoreRanking): resolve the account ID rankings with their declared type The four account ID ranking calls take const std::uint64_t* account IDs, but the test called them through the PcId calls' const void* type, which clang's function sanitizer reports as undefined behaviour. They now use a function type that matches their declarations. --- core/libs/tests/GuestNpScoreOffline.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/libs/tests/GuestNpScoreOffline.cpp b/core/libs/tests/GuestNpScoreOffline.cpp index 7a4269eb51..285a181019 100644 --- a/core/libs/tests/GuestNpScoreOffline.cpp +++ b/core/libs/tests/GuestNpScoreOffline.cpp @@ -40,6 +40,7 @@ unsigned char npIdPcIds[2 * 44]; unsigned char accountIdPcIds[2 * 16]; using RankingFn = int (APS5_VABI*)(int, std::uint32_t, const void*, std::uint64_t, void*, std::uint64_t, void*, std::uint64_t, void*, std::uint64_t, std::uint64_t, void*, void*, void*); +using AccountRankingFn = int (APS5_VABI*)(int, std::uint32_t, const std::uint64_t*, std::uint64_t, void*, std::uint64_t, void*, std::uint64_t, void*, std::uint64_t, std::uint64_t, void*, void*, void*); using RangeFn = int (APS5_VABI*)(int, std::uint32_t, std::uint32_t, void*, std::uint64_t, void*, std::uint64_t, void*, std::uint64_t, std::uint64_t, void*, void*, void*); using FriendsFn = int (APS5_VABI*)(int, std::uint32_t, int, void*, std::uint64_t, void*, std::uint64_t, void*, std::uint64_t, std::uint64_t, void*, void*, const NpScoreFriendRankingOption*); using GameDataFn = int (APS5_VABI*)(int, std::uint32_t, const void*, std::uint64_t*, std::uint64_t, void*, void*); @@ -242,8 +243,8 @@ void CheckRangeAndFriendsA() { } void CheckAccountIds() { - const auto byAccountId = Resolve("sceNpScoreGetRankingByAccountId"); - const auto byAccountIdAsync = Resolve("sceNpScoreGetRankingByAccountIdAsync"); + const auto byAccountId = Resolve("sceNpScoreGetRankingByAccountId"); + const auto byAccountIdAsync = Resolve("sceNpScoreGetRankingByAccountIdAsync"); const auto byAccountIdPcId = Resolve("sceNpScoreGetRankingByAccountIdPcId"); const auto byAccountIdPcIdAsync = Resolve("sceNpScoreGetRankingByAccountIdPcIdAsync"); int req = NewRequest(); @@ -341,8 +342,8 @@ void CheckCrossSave() { const auto byRangeAsync = Resolve("sceNpScoreGetRankingByRangeForCrossSaveAsync"); const auto friends = Resolve("sceNpScoreGetFriendsRankingForCrossSave"); const auto friendsAsync = Resolve("sceNpScoreGetFriendsRankingForCrossSaveAsync"); - const auto byAccountId = Resolve("sceNpScoreGetRankingByAccountIdForCrossSave"); - const auto byAccountIdAsync = Resolve("sceNpScoreGetRankingByAccountIdForCrossSaveAsync"); + const auto byAccountId = Resolve("sceNpScoreGetRankingByAccountIdForCrossSave"); + const auto byAccountIdAsync = Resolve("sceNpScoreGetRankingByAccountIdForCrossSaveAsync"); const auto byAccountIdPcId = Resolve("sceNpScoreGetRankingByAccountIdPcIdForCrossSave"); const auto byAccountIdPcIdAsync = Resolve("sceNpScoreGetRankingByAccountIdPcIdForCrossSaveAsync"); int req = NewRequest();