feat(icu): format numbers with field position iterators #26173

Open
IvanFogel wants to merge 296 commits from upstream-pr/26173 into main
IvanFogel commented 2026-11-23 11:30:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by IvanFogel on 2026-11-23T11:30:38Z.


What

Implement the existing unum_formatDoubleForFields export. Titles can format a number as a localized string and iterate the sign, integer, fraction, grouping, decimal separator, percent and currency spans in UTF-16 code units. A formatting preflight or short output still populates the field iterator. Reusing an iterator replaces its old fields and restarts traversal.

The existing formatter and iterator registries validate guest handles and synchronize formatting with close and iteration. Formatting and offsets are staged with bundled ICU 78.1 before publishing field ranges to the guest iterator. Each changed output span, including status, is held open with the guest arena’s host-write scope before testing its temporary host protection. All spans are validated before the first guest result write. Rejected guest writes retain the previous iterator. C++ staging allocation failures return zero and ICU’s allocation error. When one of the three ICU formatting probes itself reports an allocation error, the guest immediately receives that failing call’s native return length and error, with its output and field iterator untouched. The replacement field list is prepared in a separate native ICU iterator before writing guest text or status. After the checked writes succeed, the registry switches the existing guest handle to the prepared native iterator. A failed replacement returns zero and the ICU memory-allocation error. Both the text and the position in the previous field list survive. The C entry points in ICU 68.2 and ICU 78.1 share the same argument checks, formatter call and result extraction. Console field data and allocator failure behavior remain unverified.

Draft. #19720 supplies the live guest classic number formatter handles, locale data and existing checked string output. Its opening prerequisite at 73c0847d0fd5907bfd52f165c7ca2554b5b31053 expressly deferred this export. Both that head and main fe540db950a61dfb5f5ddfc3c940a7c4738783b6 are included. The additional feature commit is ba3bf4476c908804b796b6b59b56f1f04a127822. Lystea11’s date formatter PR #24402 also needs to reserve a guest field iterator while formatting. Its six-line lock helper, declarations and iterator consumer are included here from head 44b621151ff3f0bc07e02766e269478a81c6ca44 and credited in the feature commit. This revision extends the shared helper so a locked native formatter sees the current field list for the original guest handle. The requested order is still #24402 first. On integration, retain the lookup of that current native iterator. The full branch merge still conflicts in ICU CMake registration, recovered signatures, the standard-name test and inherited build/debt files. #19720 is the runtime formatter prerequisite. No date formatting code or data-provider change is needed for this feature. The repository name scan checked 2,538 open PRs and found no open implementation change for this export. The opening exact-branch scan fetched 2,551 open PRs and reported 43 peers, including 35 whose overlapping paths the tool could not compare. All reported heads were separately pinned and their shared paths and formatter bodies inspected. No other implementation of this guest export was found. Other inherited ICU/test/debt changes need integration with adjacent branches. The date-formatter interoperation run below uses its formatter translation unit. At main 63b98e5bf852, the shared ICU enumeration and right-to-left test still conflict. The coordinated ICU rebase is waiting on #16971.

Tested

December 4, commit 1760f6a79809. The previous commit published new text when ICU refused the backing storage for the final field list. The regression failed for that reason on Linux and MinGW-w64/Wine. It now separately refuses the field vector and its backing buffer at capacities 0, 1, 2 and 8. In all eight cases it checks the error, zero return, every UTF-16 unit and the previous iterator’s partially consumed position. A second check denies guest output both during validation and during the final copy. The full ICU/public-header selection passed 128/128 on Linux and 128/128 on MinGW-w64/Wine with zero skips.

I also compiled the unmodified date formatter translation unit from #24402 (b2188fa8af62) against this revision. A single guest iterator alternated between signed-number and date formatting three times, returning the expected year, month and day spans and then the original numeric sign and integer spans. The probe passed on Linux and MinGW-w64/Wine. All Windows-format executions in this update used Wine.

November 25, commit d3104fca9730. I integrated main 9c0d60cbfb6e. The branch now includes the revised number formatter prerequisite from #19720. It preserves main’s prefailed numbering-system guards and ICU data sources alongside the owned formatter and field-iterator implementation. The data-backed fixture now tests inferred regions against bundled likely-subtag data. Its fallback case uses the unassigned locale de_QM, so the expected parent-locale warning is tested even with the full ICU data installed. On this commit, 128 Linux and 128 MinGW-w64/Wine CTests passed, covering every registered guest ICU test and the public-header check.

Arch Linux x86-64, GCC 16.2.1, and Win64 MinGW GCC 16.2.0 under Wine 11.22 on Linux. No native Windows, macOS, console or retail title run.

  • Exact head 87000974315d3486af82478bca99baa1c74bd27e passed 121/121 ICU and public-header CTests on Linux and 121/121 on MinGW/Wine, with zero skips or failures. Maximum test times were 7.693s and 4.879s respectively. Both profiles independently compiled every listed ICU public header and the additional changed private headers (56 standalone units per profile).
  • An isolated test installs guest ICU allocation callbacks and refuses exactly one real UTF-16 buffer allocation for a long numeric prefix. It separately exercises preflight and both bounded output probes. Each failure preserves the old integer field, the full guarded output and native partial length 1 with status 7. Before the fix the second probe threw an unimplemented exception. This case passed on Linux and Wine.
  • The watched-memory regression armed a real shared Windows guest mapping and verified both guest text and status were temporarily host PAGE_READONLY. The published predecessor rejected it under Wine; the updated head formats both full-capacity and exact-fit output and updates the warning and field iterator correctly. The guest write-watch fixture also ran on Linux. A separate injected host staging allocation failure verifies the guest-facing error, preserved output and iterator. The final native allocation-failure boundary described above was source-inspected.
  • On both Linux and Wine the new guest test first stopped at the predecessor’s valid-call exception. All eight current classic number CTests passed on each platform, including a runtime lookup of the real packaged PRX by the four formatting and iterator NIDs.
  • The differential compares 288 combinations of locale, style, output capacity, warning status and optional field iterator with the bundled native ICU formatter. It checks the whole guarded output buffer, field ordering and UTF-16 ranges. A literal US currency check verifies six fields. Other cases check preflight, iterator reuse, unsupported styles, refused buffers/statuses, preserved pending fields and exact rounding errors.
  • The debt-fold checker and git diff --check passed. The earlier pending fragments are reconciled in place because the fold tool rejects a second fragment targeting an entry added or changed by another pending fragment.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #19720, #24402
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5452224046 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26173). Originally posted by [IvanFogel](https://github.com/IvanFogel) on 2026-11-23T11:30:38Z. --- ### What Implement the existing `unum_formatDoubleForFields` export. Titles can format a number as a localized string and iterate the sign, integer, fraction, grouping, decimal separator, percent and currency spans in UTF-16 code units. A formatting preflight or short output still populates the field iterator. Reusing an iterator replaces its old fields and restarts traversal. The existing formatter and iterator registries validate guest handles and synchronize formatting with close and iteration. Formatting and offsets are staged with bundled ICU 78.1 before publishing field ranges to the guest iterator. Each changed output span, including status, is held open with the guest arena’s host-write scope before testing its temporary host protection. All spans are validated before the first guest result write. Rejected guest writes retain the previous iterator. C++ staging allocation failures return zero and ICU’s allocation error. When one of the three ICU formatting probes itself reports an allocation error, the guest immediately receives that failing call’s native return length and error, with its output and field iterator untouched. The replacement field list is prepared in a separate native ICU iterator before writing guest text or status. After the checked writes succeed, the registry switches the existing guest handle to the prepared native iterator. A failed replacement returns zero and the ICU memory-allocation error. Both the text and the position in the previous field list survive. The C entry points in [ICU 68.2](https://github.com/unicode-org/icu/blob/84e1f26ea77152936e70d53178a816dbfbf69989/icu4c/source/i18n/unum.cpp#L256-L281) and [ICU 78.1](https://github.com/unicode-org/icu/blob/049e0d6a420629ac7db77256987d083a563287b5/icu4c/source/i18n/unum.cpp#L269-L294) share the same argument checks, formatter call and result extraction. Console field data and allocator failure behavior remain unverified. **Draft.** #19720 supplies the live guest classic number formatter handles, locale data and existing checked string output. Its opening prerequisite at `73c0847d0fd5907bfd52f165c7ca2554b5b31053` expressly deferred this export. Both that head and main `fe540db950a61dfb5f5ddfc3c940a7c4738783b6` are included. The additional feature commit is `ba3bf4476c908804b796b6b59b56f1f04a127822`. Lystea11’s date formatter PR #24402 also needs to reserve a guest field iterator while formatting. Its six-line lock helper, declarations and iterator consumer are included here from head `44b621151ff3f0bc07e02766e269478a81c6ca44` and credited in the feature commit. This revision extends the shared helper so a locked native formatter sees the current field list for the original guest handle. The requested order is still #24402 first. On integration, retain the lookup of that current native iterator. The full branch merge still conflicts in ICU CMake registration, recovered signatures, the standard-name test and inherited build/debt files. #19720 is the runtime formatter prerequisite. No date formatting code or data-provider change is needed for this feature. The repository name scan checked 2,538 open PRs and found no open implementation change for this export. The opening exact-branch scan fetched 2,551 open PRs and reported 43 peers, including 35 whose overlapping paths the tool could not compare. All reported heads were separately pinned and their shared paths and formatter bodies inspected. No other implementation of this guest export was found. Other inherited ICU/test/debt changes need integration with adjacent branches. The date-formatter interoperation run below uses its formatter translation unit. At main `63b98e5bf852`, the shared ICU enumeration and right-to-left test still conflict. The coordinated ICU rebase is waiting on #16971. ### Tested **December 4, commit `1760f6a79809`.** The previous commit published new text when ICU refused the backing storage for the final field list. The regression failed for that reason on Linux and MinGW-w64/Wine. It now separately refuses the field vector and its backing buffer at capacities 0, 1, 2 and 8. In all eight cases it checks the error, zero return, every UTF-16 unit and the previous iterator’s partially consumed position. A second check denies guest output both during validation and during the final copy. The full ICU/public-header selection passed 128/128 on Linux and 128/128 on MinGW-w64/Wine with zero skips. I also compiled the unmodified date formatter translation unit from #24402 (`b2188fa8af62`) against this revision. A single guest iterator alternated between signed-number and date formatting three times, returning the expected year, month and day spans and then the original numeric sign and integer spans. The probe passed on Linux and MinGW-w64/Wine. All Windows-format executions in this update used Wine. **November 25, commit `d3104fca9730`.** I integrated main `9c0d60cbfb6e`. The branch now includes the revised number formatter prerequisite from #19720. It preserves main’s prefailed numbering-system guards and ICU data sources alongside the owned formatter and field-iterator implementation. The data-backed fixture now tests inferred regions against bundled likely-subtag data. Its fallback case uses the unassigned locale de_QM, so the expected parent-locale warning is tested even with the full ICU data installed. On this commit, 128 Linux and 128 MinGW-w64/Wine CTests passed, covering every registered guest ICU test and the public-header check. Arch Linux x86-64, GCC 16.2.1, and Win64 MinGW GCC 16.2.0 under Wine 11.22 on Linux. No native Windows, macOS, console or retail title run. - Exact head `87000974315d3486af82478bca99baa1c74bd27e` passed 121/121 ICU and public-header CTests on Linux and 121/121 on MinGW/Wine, with zero skips or failures. Maximum test times were 7.693s and 4.879s respectively. Both profiles independently compiled every listed ICU public header and the additional changed private headers (56 standalone units per profile). - An isolated test installs guest ICU allocation callbacks and refuses exactly one real UTF-16 buffer allocation for a long numeric prefix. It separately exercises preflight and both bounded output probes. Each failure preserves the old integer field, the full guarded output and native partial length 1 with status 7. Before the fix the second probe threw an unimplemented exception. This case passed on Linux and Wine. - The watched-memory regression armed a real shared Windows guest mapping and verified both guest text and status were temporarily host PAGE_READONLY. The published predecessor rejected it under Wine; the updated head formats both full-capacity and exact-fit output and updates the warning and field iterator correctly. The guest write-watch fixture also ran on Linux. A separate injected host staging allocation failure verifies the guest-facing error, preserved output and iterator. The final native allocation-failure boundary described above was source-inspected. - On both Linux and Wine the new guest test first stopped at the predecessor’s valid-call exception. All eight current classic number CTests passed on each platform, including a runtime lookup of the real packaged PRX by the four formatting and iterator NIDs. - The differential compares 288 combinations of locale, style, output capacity, warning status and optional field iterator with the bundled native ICU formatter. It checks the whole guarded output buffer, field ordering and UTF-16 ranges. A literal US currency check verifies six fields. Other cases check preflight, iterator reuse, unsupported styles, refused buffers/statuses, preserved pending fields and exact rounding errors. - The debt-fold checker and `git diff --check` passed. The earlier pending fragments are reconciled in place because the fold tool rejects a second fragment targeting an entry added or changed by another pending fragment. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #19720, #24402 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-25 08:29:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T08:29:23Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Reviewed head 87000974315d3486af82478bca99baa1c74bd27e. I read the prepared description, commits, manifest, and diff, then inspected the changed number-format implementation, its backend, and the field-iterator locking path through repo_read.py. No tests were run; reported test results below are author-supplied.

Results

Check Result Note
Source review passed Formatter and iterator paths inspected
Linux and MinGW/Wine CTests not run Author reports 121/121 on each
Console behavior not run ABI and field behavior unverified

Findings

Blocking

None.

Non-blocking

  • The implementation deliberately calls ICU formatting multiple times to stage and validate bounded output. The review did not run the reported differential and allocation-failure tests; retaining those checks in CI will help protect the repeated-call assumptions.

Not verified

I did not inspect every changed file in the 4,993-line manifest or the full inherited ICU build, feature, and test changes. The manifest reports changed files as included, but the prepared review folder does not expose its individual files through the reader listing. I reviewed the formatter-focused diff and selected source ranges. I did not run tests or verify console behavior. The reported Linux and MinGW/Wine results are from the PR description, not runs performed in this review.

To get this to a good state

Nothing is required. The console comparison and reported test coverage remain useful follow-up evidence.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6054142130 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26173#pullrequestreview-6054142130). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T08:29:23Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran Reviewed head `87000974315d3486af82478bca99baa1c74bd27e`. I read the prepared description, commits, manifest, and diff, then inspected the changed number-format implementation, its backend, and the field-iterator locking path through `repo_read.py`. No tests were run; reported test results below are author-supplied. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Formatter and iterator paths inspected | | Linux and MinGW/Wine CTests | not run | Author reports 121/121 on each | | Console behavior | not run | ABI and field behavior unverified | ## Findings ### Blocking None. ### Non-blocking - The implementation deliberately calls ICU formatting multiple times to stage and validate bounded output. The review did not run the reported differential and allocation-failure tests; retaining those checks in CI will help protect the repeated-call assumptions. ## Not verified I did not inspect every changed file in the 4,993-line manifest or the full inherited ICU build, feature, and test changes. The manifest reports changed files as included, but the prepared review folder does not expose its individual files through the reader listing. I reviewed the formatter-focused diff and selected source ranges. I did not run tests or verify console behavior. The reported Linux and MinGW/Wine results are from the PR description, not runs performed in this review. ## To get this to a good state Nothing is required. The console comparison and reported test coverage remain useful follow-up evidence.
MarcZX10 commented 2026-11-25 10:39:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T10:39:02Z.

Review: COMMENTED


Reviewed — comments

The change adds ICU number formatting with field iteration and broad ICU integration updates; the feature code was inspected, but the full changed-file set was not reviewed, so a formal approval is not justified.

What I ran

Reviewed head d3104fca97309cc8e0da2dbf9a5a2f0de77559aa. No commands or tests were run. The author reports Linux and MinGW/Wine CTest runs in the PR description; those results were not independently verified.

Read review/description.md, review/commits.md, review/manifest.json, and the first 300 lines of review/diff.patch. At repository head, read core/libs/prx/libSceIcu/NumberFormat.cpp, core/libs/prx/libSceIcu/NumberFormatBackend.cpp, and core/libs/prx/libSceIcu/FieldPositionIterator.cpp. list_files reported all changed files included; no files were listed as excluded. The remaining changed files were not read.

Results

Check Result Note
Targeted source inspection passed Formatter and iterator paths read
Tests not run Author-reported results only
Full changed-file review not run Most changed files not read

Findings

Blocking

None identified in the inspected code.

Non-blocking

None.

Not verified

Most changed files were not read, including ICU data/build integration, date formatting, numbering systems, and their tests. The remaining diff, the console behavior, and the author-reported test results were not independently verified. No negative control was run.

To get this to a good state

Nothing is required. Optional: complete review of the remaining changed files before relying on this review as a full PR assessment.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6056013683 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26173#pullrequestreview-6056013683). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T10:39:02Z. **Review:** COMMENTED --- # Reviewed — comments The change adds ICU number formatting with field iteration and broad ICU integration updates; the feature code was inspected, but the full changed-file set was not reviewed, so a formal approval is not justified. ## What I ran Reviewed head `d3104fca97309cc8e0da2dbf9a5a2f0de77559aa`. No commands or tests were run. The author reports Linux and MinGW/Wine CTest runs in the PR description; those results were not independently verified. Read `review/description.md`, `review/commits.md`, `review/manifest.json`, and the first 300 lines of `review/diff.patch`. At repository head, read `core/libs/prx/libSceIcu/NumberFormat.cpp`, `core/libs/prx/libSceIcu/NumberFormatBackend.cpp`, and `core/libs/prx/libSceIcu/FieldPositionIterator.cpp`. `list_files` reported all changed files included; no files were listed as excluded. The remaining changed files were not read. ## Results | Check | Result | Note | |---|---|---| | Targeted source inspection | passed | Formatter and iterator paths read | | Tests | not run | Author-reported results only | | Full changed-file review | not run | Most changed files not read | ## Findings ### Blocking None identified in the inspected code. ### Non-blocking None. ## Not verified Most changed files were not read, including ICU data/build integration, date formatting, numbering systems, and their tests. The remaining diff, the console behavior, and the author-reported test results were not independently verified. No negative control was run. ## To get this to a good state Nothing is required. Optional: complete review of the remaining changed files before relying on this review as a full PR assessment.
ligmaSec commented 2026-12-03 19:37:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T19:37:16Z.

Review: COMMENTED


Output publishes text and status before SetFields_nid_no_patch creates the guest iterator's new fields. The latter builds another field vector and can fail with U_MEMORY_ALLOCATION_ERROR. In that case the caller can see the new text even though the function reports failure and may still hold fields from its prior iteration. Please prepare the replacement iterator state before any guest output, then publish the fields and text from the same completed preparation.

Source review at d3104fca97. The combined stack has a conflict in the shared RightToLeft fixture.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6177090402 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26173#pullrequestreview-6177090402). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T19:37:16Z. **Review:** COMMENTED --- `Output` publishes text and status before `SetFields_nid_no_patch` creates the guest iterator's new fields. The latter builds another field vector and can fail with `U_MEMORY_ALLOCATION_ERROR`. In that case the caller can see the new text even though the function reports failure and may still hold fields from its prior iteration. Please prepare the replacement iterator state before any guest output, then publish the fields and text from the same completed preparation. Source review at `d3104fca97`. The combined stack has a conflict in the shared RightToLeft fixture. AI-assisted: yes.
MarcZX10 commented 2026-12-04 09:58:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T09:58:34Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

Closing a registered field iterator can close the same ICU iterator twice because the extracted map node retains an owning pointer.

What I ran

Reviewed head 1760f6a7980956cbc30fc846e5d97b945d75004d by inspecting the prepared diff and selected source files; I ran no commands or tests.

Results

Check Result Note
Source review failed Found a double-close defect
Tests not run No tests run during this review
Negative control not run Could not run a negative control

Findings

Blocking

  • core/libs/prx/libSceIcu/FieldPositionIterator.cpp:21: The registry now owns each native iterator through FieldIteratorOwner. ufieldpositer_close_nid_postfix extracts that owning entry, explicitly calls ufieldpositer_close(fpositer), and then the extracted node destroys its FieldIteratorOwner, which closes the same pointer again. Remove the explicit close and let the extracted owner close it once. This can cause a double free whenever a guest closes a field iterator.

Non-blocking

None.

Sources

Not verified

The prepared manifest lists 68 reviewed files and no excluded files. I read FieldPositionIterator.cpp, FieldPositionIterator.hpp, NumberFormat.cpp, NumberFormatBackend.cpp, and NumberFormatBackend.hpp; I inspected relevant diff hunks and portions of NumberFormat.cpp and NumberFormatNid.cpp. The other manifest files were not read, so this review does not verify their behavior. No tests, builds, console runs, or allocation-failure checks were performed.

To get this to a good state

Remove the duplicate close and rerun the field iterator close and formatting tests on the updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6186956659 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26173#pullrequestreview-6186956659). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-12-04T09:58:34Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested Closing a registered field iterator can close the same ICU iterator twice because the extracted map node retains an owning pointer. ## What I ran Reviewed head `1760f6a7980956cbc30fc846e5d97b945d75004d` by inspecting the prepared diff and selected source files; I ran no commands or tests. ## Results | Check | Result | Note | |---|---|---| | Source review | failed | Found a double-close defect | | Tests | not run | No tests run during this review | | Negative control | not run | Could not run a negative control | ## Findings ### Blocking - `core/libs/prx/libSceIcu/FieldPositionIterator.cpp:21`: The registry now owns each native iterator through `FieldIteratorOwner`. `ufieldpositer_close_nid_postfix` extracts that owning entry, explicitly calls `ufieldpositer_close(fpositer)`, and then the extracted node destroys its `FieldIteratorOwner`, which closes the same pointer again. Remove the explicit close and let the extracted owner close it once. This can cause a double free whenever a guest closes a field iterator. ### Non-blocking None. ## Sources - [Field iterator registry and close path at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/1760f6a7980956cbc30fc846e5d97b945d75004d/core/libs/prx/libSceIcu/FieldPositionIterator.cpp) ## Not verified The prepared manifest lists 68 reviewed files and no excluded files. I read `FieldPositionIterator.cpp`, `FieldPositionIterator.hpp`, `NumberFormat.cpp`, `NumberFormatBackend.cpp`, and `NumberFormatBackend.hpp`; I inspected relevant diff hunks and portions of `NumberFormat.cpp` and `NumberFormatNid.cpp`. The other manifest files were not read, so this review does not verify their behavior. No tests, builds, console runs, or allocation-failure checks were performed. ## To get this to a good state Remove the duplicate close and rerun the field iterator close and formatting tests on the updated head.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/26173:upstream-pr/26173'
git switch 'upstream-pr/26173'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/26173'
git switch 'upstream-pr/26173'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/26173'
git switch 'upstream-pr/26173'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/26173'
git switch 'main'
git merge --squash 'upstream-pr/26173'
git switch 'main'
git merge --ff-only 'upstream-pr/26173'
git switch 'main'
git merge 'upstream-pr/26173'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!26173
No description provided.