fix(libkernel): preserve 64-bit metadata download sizes #661
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/661"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by NumberGuan on 2026-10-05T12:13:40Z.
What
parseParamJsonconvertsdownloadDataSizethroughdouble, which changes large integer values. For example,9007199254740993becomes9007199254740992. Converting an out-of-range floating-point value touint64_talso has undefined behavior in C++.Keep the numeric token and parse unsigned integer literals directly with
std::from_chars. Values throughUINT64_MAXremain exact, and larger integers throw. Decimal and exponent forms retain their existing conversion behavior, with a range check before the cast.Add a test linked against
libkernelfor omitted and zero sizes, normal sizes, integers above the exact range ofdouble, both upper uint64 boundaries, decimal/exponent compatibility, overflow, negative values, and invalid JSON value types.Tested
Windows, Release, WinLibs GCC 15.2.0 UCRT POSIX:
Both tests passed. The new regression test failed on the original code at
9007199254740993. No title or homebrew was run. Linux and the full suite were not run locally.Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-05T18:14:53Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/tests/ParamJsonParser.cppcore/libs/tests/ParamJsonParser.cpp