Copy the source array into this and return this, as the console does
(measured on a PS4 Pro, firmware 10.71). Knowledge is Power: Decades
imports it; the inventory stub threw NotImplemented.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Graven (PPSA09614) imports sce::Json::Array::pop_front()
(pPs3qZTZQvQ) from one call site of its executable, and no built
library exported it, so tools/import_audit.py lists it as absent and
the loader stops before the title starts.
pop_front removes the first element and destroys it, like clear does
for every element. On an empty array it throws std::out_of_range, as
front and back do here; the console's result there is unverified and
listed in the debt file.
guest_json pops both elements of a two-element copy, checks the
remaining element and the empty array, and expects the throw on a
third pop.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
main now keeps object keys sorted and stops at the end of the first
value, so the nested document lists its keys in order and "1,5" parses
as the integer 1 instead of failing.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Linux runners have no decimal-comma locale, so guest_json_numeric_locale
skipped there. Build xx_COMMA from a charmap and an LC_NUMERIC source
shipped with the test as a CTest fixture, point the test at it with
LOCPATH and try it first.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
the system export leaves the return register unspecified on missing keys and tail-calls node removal on a match. declare void and check object contents instead of a fabricated removal count. guest_json passes on windows.
Prevent decimal-comma LC_NUMERIC from emitting invalid JSON and silently truncating decimal-point input. Keep 17-digit output, signed underflow and overflow rejection without changing the process locale.
AI-assisted: yes (OpenAI Codex). Windows WinLibs GCC15.2 Release: original shared Json2 fails the final locale regression; fixed guest_json and guest_json_numeric_locale pass (2/2, no skips). Final conventions pass. Only relevant runtime/test targets built; full build/full suite and game/console/Linux/macOS behavior unverified. No performance or coverage increase claimed.
Value::setTypeMismatchHandler, setElementAccessFailureHandler and
setSpecialFloatHandler were stubs that threw NotImplemented. PPSA07411
calls all three while it sets up its documents.
The title calls them as members of Value: on its root Value before
parsing into it, with the handler and its context, and treats an int
result of 0 as success. They now store the handler and context on that
Value and on the values it holds, and return 0. A Value keeps its
handlers when its content changes (set, clear, operator=,
Parser::parse), and Parser::parse gives the values it creates the
handlers of the Value it parses into, since the title reads the errors
its handlers record after accessing parsed members. A copy does not
carry them.
A typed getter on a non-null value of another type calls the type
mismatch handler with the requested type, the value, null and the
context, and returns its result when it has the requested type, else
the getter's default.
The element access failure and special float handlers are stored but
not called: the error code the console passes to the first and the
FunctionType it passes to the second are unknown. A failed element
access on a value carrying the first throws instead of reaching the
null-access callback. Serializing a non-finite real already threw; with
the second set it throws naming the unknown FunctionType. The technical
debt entry records what is inferred.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Value::setNullAccessCallBack(callback, context) sets the callback that
Value uses for a missing member or a type mismatch. It was a stub that
aborted the title. It now sets the same global callback and context as
Initializer::setGlobalNullAccessCallBack; a null callback clears it.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
PPSA30601 imports these without a known signature. The mangled names
give them: Pair's constructor deep-copies its key and value into the
layout Object iteration already returns and its destructor frees both,
Array::iterator gets its default constructor, copy assignment and
post-increment (returning the copy through a result pointer, as begin
does), and MemAllocator::notifyError is the base class's empty virtual.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dh1MhYBFyzxRceoAxrepZ6
Resident Evil 4 (PPSA07411, #2776) and PRAGMATA (PPSA02530, #3043) stop
on the absent export with
what(): _ZN3sce4Json14InitParameter225setSpecialFloatFormatTypeENS0_22SpecialFloatFormatTypeE not implemented
Deathloop, Minecraft Legends and Cyberpunk import the base-object
constructor InitParameter2::InitParameter2(), InitParameterRtti2::
setAllocatorRtti and InitParameterRtti::InitParameterRtti(AllocParamRtti*,
void*, unsigned long), which were NotImplemented stubs.
InitParameter2 is the 40-byte object of SharpEmu and KytyPS5: the
allocator, its user data, the file buffer size and the 32-bit special
float format type at 0x18. Both constructors zero it, setAllocatorRtti
writes the allocation parameters and user data where setAllocator writes
the allocator, and setSpecialFloatFormatType stores the type.
InitParameterRtti's constructor writes its three arguments to the first
24 bytes. The NID WVZBP4IyM+E recomputes from the mangled name and is in
the aerolib database. The enum's values are unknown, so no value is
rejected; the inferred layouts are recorded in TechnicalDebt.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
(cherry picked from commit 258f2910808e5ef1636973aaefbdf51615873dcb)
Carry the implementation and regression from lucfx18's PR #2823, retaining
the original Git author. Extend the regression with a leading guard and
typed default-field checks, and record the unverified console layout.
Source: https://github.com/boykopovar/AnyPS5/pull/2823
Goat Simulator 3 (PPSA04159) imports sce::Json::Object::find(String const&)
const (ehN1Biw3tw8), Object::iterator::operator->() const (EnesV4gXDtE) and
String::compare(char const*) const (Yfw63FVJgtU); without them the Windows
entry stub stops before the game starts with "unresolved ELF import
ehN1Biw3tw8".
find returns an iterator to the first pair whose key equals the argument,
or end(), using the same key match as Object::operator[]. operator->
returns the pair like operator*. compare orders the string against a C
string as std::string::compare does; a null argument throws.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ValueClear constructs a Value, then calls the Value(const Object&)
constructor on the same object. The constructor allocates a new node and
overwrites the pointer, so the first node (56 bytes) is never freed.
LeakSanitizer reports it; destroy the value first.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb
PPSA04540 (Rise of the Ronin) imports it. The characters the callback
returns are parsed as by the (text, size) overload.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sonic Origins (PPSA05324) imports sce::Json::Object::empty() const
(i2l3IYvQ9UE) and fails to load without it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Whether the console's parser rejects 1e309 or stores an infinite real
is unknown, and RFC 8259 allows both. Following the exact-or-throw rule,
sce::Json::Parser::parse now throws with the number text and a note that
the behaviour is unverified, instead of returning JsonErrorParse. The
partially built tree is freed before the exception leaves the parser.
The case is listed under unknown function info in TechnicalDebt.md.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb
The parser stored strtod's result for 1e309 and similar numbers, so a
document with such a value parsed as an infinite real. Serializing it
then threw "cannot serialize a non-finite number", which escaped the
guest call and terminated the process. sce::Json::Parser::parse now
returns JsonErrorParse for a number that is not finite after conversion.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb