feat(libc): export the wide time_put facet vtable as data #12704
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12704"
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 mazen320 on 2026-10-29T03:27:58Z.
What
Export
time_put<wchar_t>'s vtable (NID5KOPB+1eEfs) as seven zeroeduintptr_tslots so titles that resolve it as data get a 56-byte object matching console titlelibc.prx(PPSA26344). Facet calls through the slots still fault until methods are wired (debt note). UseskTimePutWideVtableSlotswith astatic_assertand asizeofcheck like the chartime_put/num_putsize-gate. #12510 (time_put<char>) has landed. Keep-both with open #12518 and other locale facet PRs if they land first.Tested
5KOPB+1eEfsasSTT_OBJECTsize 56 on titlelibc.prxfrom PPSA26344.guest_locale_tests— passed (Windows MinGW) on tip4e487bf755164c1673669c7a14ecbeb27aa556ee.python tools/check_conventions.py --base upstream/main— passed on that tip.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 rooklz on 2026-10-29T03:45:58Z.
Review: APPROVED
Independent host check of tip
7abed65218(stacked on #12510d295b98f23), macOS 26 x86_64, clang ASan+UBSan.Names / NIDs.
tools/nid_names.py --namegives_ZTVSt8time_putIwSt19ostreambuf_iteratorIwSt11char_traitsIwEEE→5KOPB+1eEfsand thecharform →OwfBD-2nhJQ, matching the body and the debt lines. Seven slots = offset-to-top + typeinfo + the fourFacetVtableentries +TimePutVtable::put(offset 0x20 inGuestLocale.hpp), which is consistent with the measuredst_size56.Run. I built a standalone
guest_locale_testsfromLocaleSupport.cppandcore/libs/tests/GuestLocale.cppunmodified. The shim covered the heap/syslock/new/delete/__errorhooks, plussnprintf/strftimeforwarded to the host. The PR tip passes all checks exceptCheckTimePut/CheckNumPut: those fail identically onmainunder my host-strftimeshim (%E/%Ohandling), so I left them out of both runs. The other 21 checks pass on head and on main, with no sanitizer reports.Mutants on the wide vtable, all killed:
{}→{1}(non-zero slot)kTimePutWideVtableSlots = 8static_assert[6]instead of the constantconstdefinitionMerge.
git merge-treeagainstmainb433c40f2fis clean, andcheck_conventions --base upstream/mainpasses. This PR conflicts with #12518, #12511 and #10158 (adjacent appends inGuestLocale.hpp, the test file anddebt/libc.md). The body already marks those as keep-both, so that's fine.LGTM once #12510 lands.
AI-assisted: yes