feat(libSceJson2): implement sce::Json::Array::operator= #10353
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10353"
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 ntamas94 on 2026-10-23T18:54:02Z.
What
sce::Json::Array::operator=(const Array&)now copies the source array intothisand returnsthis, as the console does; onmainit is an inventory declaration that throwsNotImplemented. Knowledge is Power: Decades (CUSA12435) imports it from its Unity pluginMedia/Plugins/PS4WebAPI.prx. The copy is built first with the existingCopyArray, then the old elements are destroyed and replaced, the wayObject::operator=already works; assigning an array to itself leaves it unchanged. The inventory stub and its debt line are removed.guest_jsongainsArrayAssignment: assigning a three-element array over a one-element one returnsthis, leaves three elements in both, keeps the copy's elements after the source is cleared, and survives a self-assignment.Tested
Windows 11, MinGW-w64 GCC (winlibs), Ninja:
guest_jsonpassed on the final head (d44c823); withmain'sExport.cppandInventoryExports.cppit does not link (undefined reference to sce::Json::Array::operator=(sce::Json::Array const&)), as the inventory stub exports the name only to guests.guest_json_numeric_localeandguest_json_copy_failurepass.python tools/check_conventions.py --base origin/mainpasses.Measured on a PS4 Pro (firmware 10.71) with a homebrew probe linked against the system
libSceJson2: the array is thelistmember of a parsed document ([1,2,3]), the destination a freshly constructedArray; one line per call asfunction[label] | arguments | return | errno:The return value is the destination's own address, the copy holds three elements and the source keeps its three. Not run with a title.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T19:01:26Z.
Review: APPROVED
Reviewed the implementation against the current JSON2 ownership helpers and the reported PS4 system-library probe. The copy-before-destroy sequence preserves the destination on copy failure, avoids invalidating the source during self-assignment, and returns the destination as the probe measured. The regression test covers replacement, deep-copy independence after clearing the source, and self-assignment. The PR reports focused Windows guest tests and console probe evidence; hosted conventions, intake, eligibility, labels, and report checks pass. Product build jobs were skipped by repository policy, so I am not treating them as hosted build coverage.