feat(libSceLibcInternal): implement num_get bool parsing #24520
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24520"
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 paulk161 on 2026-11-20T18:42:43Z.
What
Implement classic
libSceLibcInternalnum_get<char>bool extraction.Numeric extraction reuses the existing integer-field parser and accepts
0and1. Other successfully parsed numeric values setfailbit. Withboolalpha, extraction matches the locale-providednumpunct<char>false and true names while preserving the first unmatched input character.The technical-debt fragment now records bool extraction as implemented while leaving pointer extraction and
num_get<wchar_t>::_Getcatdocumented as unimplemented.Tested
Windows 11, MSYS2 UCRT64:
guest_libc_internal_num_get_do_get_testsguest_libc_internal_num_get_do_get_Getffld, and_Getcatcoverage remains passinggit diff --checktools/pr_overlap.py: no overlap with open pull requestsChecklist
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-11-20T19:30:23Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: correct numeric bool parsing so
-1and overflowing values setfailbitas specified.What I ran
Reviewed head
ae8f2729f8ed64282d610dd57d520343c91f24f7. No build or tests were run. The author reports Windows 11/MSYS2 UCRT64 tests andgit diff --check; these were not independently run.Results
Findings
Blocking
core/libs/prx/libSceLibcInternal/NumGet.cpp:748uses an unsigned comparison to detect numeric values outside{0,1}. This treats-1as an unsigned value greater than or equal to two, which happens to fail, but it also fails to express the actual valid range and relies on conversion behavior. More concretely, a large positive value that overflowsint64_tcan be returned saturated by_Stolx_nid_postfixwith an error; that path does set failbit. The tested-1case is covered. On review, the substantive defect is that non-decimal bases permit signed parsing:-0converts to zero and passes, while-1fails. The bool extraction contract accepts only numeric 0 and 1; make the range check signed (parsedValue < 0 || parsedValue > 1) for clarity and correctness.Non-blocking
None.
Not verified
The build, test suite,
git diff --check, overlap check, console behavior, and test behavior beyond the source review were not run. The prepared review folder listed all three changed files as included; I read the changed implementation, its added tests, the debt fragment, and targeted parser/locale context. No changed file was excluded.To get this to a good state
Change the numeric bool range check to reject negative values and values above one, then rerun the reported bool extraction tests and
git diff --checkon the new head.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T19:54:10Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation and inspected tests support merging.
What I ran
Reviewed head
b1c70e5018fb69ced251c046a0ceda85ab99475eusingrepo_read.pyand the prepared review bundle. No build or test commands were run; the Windows/MSYS2 checks in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full test file and the debt documentation were not read in full. The reported Windows build and test run, other platforms, and console behavior were not independently verified. The changed files were
NumGet.cpp,GuestLibcInternalNumGetDoGet.cpp, andfeat-libcinternal-num-get-do-get.md; all are included in the review bundle. Targeted source ranges and changed implementation lines were read, but not every changed line in every file.To get this to a good state
Nothing is required.