fix(libSceLibcInternal): honor caller ctype facet tables #19547
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19547"
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 fogydes on 2026-11-13T14:33:24Z.
What
Correct the four unversioned
std::ctype<char>case methods to use the caller facet's lower/upper mapping tables. A custom table mappingAtozpreviously returned classic-localea; it now returnsz. Scalar and range methods use unsigned byte indices and the low byte of each short entry. Range calls include embedded NULs, reload the table pointer per element, preserve completed prefix writes on later faults, and return the original end pointer. Empty ranges return before reading the facet. Wide-character methods are unchanged.Clean-room source: readable
libc.prx, SDK 10.00, raw ELF addresses0x84080/0x840c0(scalar lower/upper),0x84090/0x840d0(ranges), table reloads0x840a3/0x840e3, empty checks0x84093/0x840d3. Signatures/layout: SDK 10.00target/include/xlocale:2461-2486,target/include/xlocinfo:51-57. These are SDK observations, not console measurements. No reference binaries or extracts are attached or linked.Unusable memory, null tables and inverted ranges throw
std::invalid_argumentas documented host-safety policy; the SDK itself does not validate these pointers. Full unversioned facet construction and global vtable population remain unverified.Measured with
tools/progress.py --module libSceLibcInternal: 424 implemented / 706 TODO / 1130 total, unchanged before/after. The four NIDs were already present:tools/export_gap.pyreports 0 missing / 4 provided / 0 unknown before/after. This corrects behavior without claiming increased export coverage.The original implementation and overlap audit used main snapshot
228330220ba. Requiredtools/pr_overlap.py --branch fix/libSceLibcInternal-ctype-facet-tablesinspected 1510 open heads and 36 relevant branches; it exited 2 because seven stale PRs could not be compared cleanly. Their exact heads/shared diffs were manually checked: no competing table-driven implementation, facet-layout collision or behavior dependency. Same-export overlap with #17300 remains: it renames an old throwing scalar-uppercase stub already superseded by main's typed provider; retain that provider when rebasing it. The grouped CMake registration avoids the prior EOF conflicts. No conflict-free claim is made for those stale whole branches.Tested
Current head
2d19cbcd13c3f8e3826139dd2b5113d31c880962, based on mainca6f82ff3d9: Windows 11 / WinLibs GCC 15.2 Release affected build and 6/6 selected CTests pass (guest_ctype_case,guest_libc_internal_ctype,guest_locale,guest_appcontent,guest_ces_wide,guest_ces_wide_module). Main includes the CES timeout fixbbc937d0553and merged AppContent regression revert #20058. Current conventions and merge-tree checks pass. The ctype implementation/test blobs are unchanged; older measurements and validation below retain their original revision scope.ctest -R '^guest_(ctype_case|libc_internal_ctype|locale)$' --output-on-failurepassed 3/3 on the final implementation from D drive.expected=z actual=a, exit 1; corrected table behavior passes the focused suite.check_conventions.py --base origin/mainandgit diff --checkpassed. Overlap limitations are disclosed above.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)