fix(libc): return positive zero when float parsing consumes no input #3905

Merged
aureau merged 3 commits from upstream-pr/3905 into main 2026-10-12 13:34:59 +00:00
aureau commented 2026-10-11 19:03:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by aureau on 2026-10-11T19:03:03Z.


What

Fixes #3090. On Windows, floating-point conversions can return negative zero when they consume no input. Return positive zero in that case while preserving valid negative-zero conversions and the end pointer’s behavior.

Adds regression coverage for the narrow and wide conversion functions. This carries forward work from #2725 and #3613, rebased onto current main and shared by @ArekatlaNishanthchowdary. The original commit authorship is preserved. The earlier PRs closed for administrative reasons.

Tested

  • Windows host unit-test build
  • guest_math, guest_strings, and guest_wide_strings: passed five consecutive runs with the fix
  • Regression comparison: guest_math failed against the original Strings.cpp; all three focused tests passed with the fix
  • tools/check_conventions.py --base origin/main: passed
  • Full CTest: 99% passed; 5 failures and 5 skipped out of 836 tests. Failures: guest_kernel_sys, windows_exceptions, agc_driver_emulated_color_compare, agc_driver_sampled_cache_budget, and guest_filesystem
  • Follow-up: agc_driver_sampled_cache_budget passed five consecutive reruns
  • Linux: Not run
  • No title or homebrew run

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
  • Unimplemented paths throw (NotImplemented_nid_no_patch); no silent stubs added
  • No notes, investigation .md files, or images added to the repository
  • New third-party code is a submodule built from source (no third-party code added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4821540947 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3905). Originally posted by [aureau](https://github.com/aureau) on 2026-10-11T19:03:03Z. --- ### What Fixes #3090. On Windows, floating-point conversions can return negative zero when they consume no input. Return positive zero in that case while preserving valid negative-zero conversions and the end pointer’s behavior. Adds regression coverage for the narrow and wide conversion functions. This carries forward work from #2725 and #3613, rebased onto current `main` and shared by [@ArekatlaNishanthchowdary](https://github.com/boykopovar/AnyPS5/issues/3090#issuecomment-6111129401). The original commit authorship is preserved. The earlier PRs closed for administrative reasons. ### Tested - Windows host unit-test build - `guest_math`, `guest_strings`, and `guest_wide_strings`: passed five consecutive runs with the fix - Regression comparison: `guest_math` failed against the original `Strings.cpp`; all three focused tests passed with the fix - `tools/check_conventions.py --base origin/main`: passed - Full CTest: 99% passed; 5 failures and 5 skipped out of 836 tests. Failures: `guest_kernel_sys`, `windows_exceptions`, `agc_driver_emulated_color_compare`, `agc_driver_sampled_cache_budget`, and `guest_filesystem` - Follow-up: `agc_driver_sampled_cache_budget` passed five consecutive reruns - Linux: Not run - No title or homebrew run ### Checklist - [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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); no silent stubs added - [x] No notes, investigation `.md` files, or images added to the repository - [x] New third-party code is a submodule built from source (no third-party code added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
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!3905
No description provided.