feat(libc): implement std::_Throw_bad_optional_access #7872

Merged
ErenYeager1836 merged 2 commits from upstream-pr/7872 into main 2026-10-19 18:21:55 +00:00
ErenYeager1836 commented 2026-10-19 11:53:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ErenYeager1836 on 2026-10-19T11:53:31Z.


What

Implements std::_Throw_bad_optional_access (_ZSt26_Throw_bad_optional_accessv, NID KwzEip7m6TM) and the std::bad_optional_access exception class plumbing in core/libs/prx/libc/src/exception/StandardExceptions.cpp:

  • Defines bad_optional_access typeinfo, vtable, constructors (_ZNSt19bad_optional_accessC1Ev, C2Ev), destructors (D1Ev, D2Ev, D0Ev), and what() returning "bad_optional_access" (matching Dinkumware and libc++ conventions).
  • Exports _ZTISt19bad_optional_access_nid_postfix and _ZTSSt19bad_optional_access_nid_postfix.
  • Fixes part of #7624, unblocking KwzEip7m6TM for PPSA26578 (Unity/IL2CPP) and PPSA34015 (EA SPORTS FC 27).
  • Documents in docs/dev/debt/libc.md with explicit note that the console libc.prx string is unverified.
  • Incorporates the complete exception exports and test from #6079 with the requested libc++ string convention and debt note, providing a single consolidated implementation.

Tested

  • guest_bad_optional_access unit test passes locally with CTest (100% tests passed out of 1).
  • ExceptionRuntime catch coverage tests throwing and catching by const std::bad_optional_access&.
  • python tools/check_conventions.py --base upstream/main passes 100%.

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); 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: none
  • Fixes: part of #7624
  • Unblocks: PPSA26578, PPSA34015
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4920497521 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7872). Originally posted by [ErenYeager1836](https://github.com/ErenYeager1836) on 2026-10-19T11:53:31Z. --- ### What Implements `std::_Throw_bad_optional_access` (`_ZSt26_Throw_bad_optional_accessv`, NID `KwzEip7m6TM`) and the `std::bad_optional_access` exception class plumbing in `core/libs/prx/libc/src/exception/StandardExceptions.cpp`: - Defines `bad_optional_access` typeinfo, vtable, constructors (`_ZNSt19bad_optional_accessC1Ev`, `C2Ev`), destructors (`D1Ev`, `D2Ev`, `D0Ev`), and `what()` returning `"bad_optional_access"` (matching Dinkumware and libc++ conventions). - Exports `_ZTISt19bad_optional_access_nid_postfix` and `_ZTSSt19bad_optional_access_nid_postfix`. - Fixes part of #7624, unblocking `KwzEip7m6TM` for PPSA26578 (Unity/IL2CPP) and PPSA34015 (EA SPORTS FC 27). - Documents in `docs/dev/debt/libc.md` with explicit note that the console libc.prx string is unverified. - Incorporates the complete exception exports and test from #6079 with the requested libc++ string convention and debt note, providing a single consolidated implementation. ### Tested - `guest_bad_optional_access` unit test passes locally with CTest (`100% tests passed out of 1`). - `ExceptionRuntime` catch coverage tests throwing and catching by `const std::bad_optional_access&`. - `python tools/check_conventions.py --base upstream/main` passes 100%. ### 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`); silent stubs are listed under Silent stubs in their library's technical 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: none - [x] Fixes: part of #7624 - [x] Unblocks: PPSA26578, PPSA34015 - [x] GPUs tested: n/a - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-19 11:54:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T11:54:19Z.


Progress report (d047690 → e775e45)

📈 System libraries: 79.77% (+0.03%, +7 implemented functions)

✅ 7 implemented
Library Name
libc _ZNKSt19bad_optional_access4whatEv_nid_postfix
libc _ZNSt19bad_optional_accessC1Ev_nid_postfix
libc _ZNSt19bad_optional_accessC2Ev_nid_postfix
libc _ZNSt19bad_optional_accessD0Ev_nid_postfix
libc _ZNSt19bad_optional_accessD1Ev_nid_postfix
libc _ZNSt19bad_optional_accessD2Ev_nid_postfix
libc _ZSt26_Throw_bad_optional_accessv_nid_postfix
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6266593437 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7872#issuecomment-6266593437). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T11:54:19Z. --- <!-- progress-report --> ### Progress report (d047690 → e775e45) 📈 **System libraries**: 79.77% (+0.03%, +7 implemented functions) <details> <summary>✅ 7 implemented</summary> | Library | Name | | - | - | | libc | `_ZNKSt19bad_optional_access4whatEv_nid_postfix` | | libc | `_ZNSt19bad_optional_accessC1Ev_nid_postfix` | | libc | `_ZNSt19bad_optional_accessC2Ev_nid_postfix` | | libc | `_ZNSt19bad_optional_accessD0Ev_nid_postfix` | | libc | `_ZNSt19bad_optional_accessD1Ev_nid_postfix` | | libc | `_ZNSt19bad_optional_accessD2Ev_nid_postfix` | | libc | `_ZSt26_Throw_bad_optional_accessv_nid_postfix` | </details>
github-actions[bot] commented 2026-10-19 12:00:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T12:00:38Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 5303 docs/dev/debt/libc.md L100
PR 6079 _ZNKSt19bad_optional_access4whatEv_nid_postfix
_ZNSt19bad_optional_accessC1Ev_nid_postfix
_ZNSt19bad_optional_accessC2Ev_nid_postfix
_ZNSt19bad_optional_accessD0Ev_nid_postfix
_ZNSt19bad_optional_accessD1Ev_nid_postfix
_ZNSt19bad_optional_accessD2Ev_nid_postfix
_ZSt26_Throw_bad_optional_accessv_nid_postfix
core/libs/tests/GuestBadOptionalAccess.cpp
PR 7386 docs/dev/debt/libc.md L100-101
PR 7525 docs/dev/debt/libc.md L100-101

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5021 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 6044 core/libs/prx/libc/CMakeLists.txt
core/libs/tests/ExceptionRuntime.cpp
PR 6079 core/libs/prx/libc/CMakeLists.txt
core/libs/prx/libc/src/exception/StandardExceptions.cpp
core/libs/tests/GuestBadOptionalAccess.cpp
PR 6226 docs/dev/debt/libc.md
PR 6469 docs/dev/debt/libc.md
PR 6819 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7081 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7201 core/libs/prx/libc/CMakeLists.txt
core/libs/tests/ExceptionRuntime.cpp
PR 7332 core/libs/prx/libc/CMakeLists.txt
core/libs/tests/ExceptionRuntime.cpp
docs/dev/debt/libc.md
PR 7417 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
PR 7473 docs/dev/debt/libc.md
PR 7715 core/libs/prx/libc/CMakeLists.txt
docs/dev/debt/libc.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6266700815 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7872#issuecomment-6266700815). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T12:00:38Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 5303](https://www.github.com/boykopovar/AnyPS5/pull/5303) | `docs/dev/debt/libc.md` [L100](https://github.com/boykopovar/AnyPS5/blob/f52509acc7d6db75e54d482775b20cc2b7e31057/docs/dev/debt/libc.md#L100) | | | | [PR 6079](https://www.github.com/boykopovar/AnyPS5/pull/6079) | | `_ZNKSt19bad_optional_access4whatEv_nid_postfix`<br>`_ZNSt19bad_optional_accessC1Ev_nid_postfix`<br>`_ZNSt19bad_optional_accessC2Ev_nid_postfix`<br>`_ZNSt19bad_optional_accessD0Ev_nid_postfix`<br>`_ZNSt19bad_optional_accessD1Ev_nid_postfix`<br>`_ZNSt19bad_optional_accessD2Ev_nid_postfix`<br>`_ZSt26_Throw_bad_optional_accessv_nid_postfix` | `core/libs/tests/GuestBadOptionalAccess.cpp` | | [PR 7386](https://www.github.com/boykopovar/AnyPS5/pull/7386) | `docs/dev/debt/libc.md` [L100-101](https://github.com/boykopovar/AnyPS5/blob/f52509acc7d6db75e54d482775b20cc2b7e31057/docs/dev/debt/libc.md#L100-L101) | | | | [PR 7525](https://www.github.com/boykopovar/AnyPS5/pull/7525) | `docs/dev/debt/libc.md` [L100-101](https://github.com/boykopovar/AnyPS5/blob/f52509acc7d6db75e54d482775b20cc2b7e31057/docs/dev/debt/libc.md#L100-L101) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libc/CMakeLists.txt`<br>`docs/dev/debt/libc.md` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libc/CMakeLists.txt`<br>`core/libs/tests/ExceptionRuntime.cpp` | | [PR 6079](https://www.github.com/boykopovar/AnyPS5/pull/6079) | `core/libs/prx/libc/CMakeLists.txt`<br>`core/libs/prx/libc/src/exception/StandardExceptions.cpp`<br>`core/libs/tests/GuestBadOptionalAccess.cpp` | | [PR 6226](https://www.github.com/boykopovar/AnyPS5/pull/6226) | `docs/dev/debt/libc.md` | | [PR 6469](https://www.github.com/boykopovar/AnyPS5/pull/6469) | `docs/dev/debt/libc.md` | | [PR 6819](https://www.github.com/boykopovar/AnyPS5/pull/6819) | `core/libs/prx/libc/CMakeLists.txt`<br>`docs/dev/debt/libc.md` | | [PR 7081](https://www.github.com/boykopovar/AnyPS5/pull/7081) | `core/libs/prx/libc/CMakeLists.txt`<br>`docs/dev/debt/libc.md` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libc/CMakeLists.txt`<br>`core/libs/tests/ExceptionRuntime.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libc/CMakeLists.txt`<br>`core/libs/tests/ExceptionRuntime.cpp`<br>`docs/dev/debt/libc.md` | | [PR 7417](https://www.github.com/boykopovar/AnyPS5/pull/7417) | `core/libs/prx/libc/CMakeLists.txt`<br>`docs/dev/debt/libc.md` | | [PR 7473](https://www.github.com/boykopovar/AnyPS5/pull/7473) | `docs/dev/debt/libc.md` | | [PR 7715](https://www.github.com/boykopovar/AnyPS5/pull/7715) | `core/libs/prx/libc/CMakeLists.txt`<br>`docs/dev/debt/libc.md` |
fogydes commented 2026-10-19 12:25:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fogydes on 2026-10-19T12:25:28Z.

Review: COMMENTED


Verified the implementation and test in PR #7872:

  • Implementation: _ZSt26_Throw_bad_optional_accessv_nid_postfix follows the exact pattern of neighboring exceptions (_throw_bad_variant_access, _Throw_bad_weak_ptr), properly establishing type info and throwing via ThrowPlain with what() returning "bad_optional_access".
  • Unit Test: core/libs/tests/ExceptionRuntime.cpp verifies that calling the export throws an exception caught as std::bad_optional_access with the expected what() string.
  • Technical Debt: docs/dev/debt/libc.md updated cleanly.
  • Conventions: No code comments added; code conventions check passed.

The CI conventions workflow is currently failing because the pull request description does not include the required template sections from .github/pull_request_template.md. Updating the PR body with ### Tested and ### Checklist will clear this check:

### What

PPSA26578 (issue #7624) imports `_ZSt26_Throw_bad_optional_accessv` (NID `KwzEip7m6TM`) from `libc`, and its bundled `libc.prx` does not export it, causing the process to exit at start-up on `main` with:

```text
0xC0000139 (GetLastError: 127)
unresolved ELF import KwzEip7m6TM from libc.prx

This implements std::_Throw_bad_optional_access following the neighboring bad_variant_access and bad_weak_ptr pattern:

  • _ZTISt19bad_optional_access_nid_postfix and _ZTVSt19bad_optional_access_nid_postfix type record and vtable deriving from std::exception.
  • _ZSt26_Throw_bad_optional_accessv_nid_postfix() throwing through ThrowPlain.
  • what() returning "bad_optional_access", matching Dinkumware / libc++ conventions.
  • Unit test coverage in ExceptionRuntime.cpp verifying the exception is caught as std::bad_optional_access.

Fixes part of #7624.

Tested

Windows 11, MinGW-w64 GCC 15.2.0 (Release). Verified build and test in ExceptionRuntime.cpp.

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); 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: none
  • Fixes: none
  • Unblocks: PPSA26578 #7624
  • GPUs tested: n/a
  • AI-assisted: no
*(If AI assistance was used, adjust `AI-assisted` to `yes`)*.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5571491907 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7872#pullrequestreview-5571491907). Originally posted by [fogydes](https://github.com/fogydes) on 2026-10-19T12:25:28Z. **Review:** COMMENTED --- Verified the implementation and test in PR #7872: - **Implementation**: `_ZSt26_Throw_bad_optional_accessv_nid_postfix` follows the exact pattern of neighboring exceptions (`_throw_bad_variant_access`, `_Throw_bad_weak_ptr`), properly establishing type info and throwing via `ThrowPlain` with `what()` returning `"bad_optional_access"`. - **Unit Test**: `core/libs/tests/ExceptionRuntime.cpp` verifies that calling the export throws an exception caught as `std::bad_optional_access` with the expected `what()` string. - **Technical Debt**: `docs/dev/debt/libc.md` updated cleanly. - **Conventions**: No code comments added; code conventions check passed. The CI `conventions` workflow is currently failing because the pull request description does not include the required template sections from `.github/pull_request_template.md`. Updating the PR body with `### Tested` and `### Checklist` will clear this check: ```markdown ### What PPSA26578 (issue #7624) imports `_ZSt26_Throw_bad_optional_accessv` (NID `KwzEip7m6TM`) from `libc`, and its bundled `libc.prx` does not export it, causing the process to exit at start-up on `main` with: ```text 0xC0000139 (GetLastError: 127) unresolved ELF import KwzEip7m6TM from libc.prx ``` This implements `std::_Throw_bad_optional_access` following the neighboring `bad_variant_access` and `bad_weak_ptr` pattern: - `_ZTISt19bad_optional_access_nid_postfix` and `_ZTVSt19bad_optional_access_nid_postfix` type record and vtable deriving from `std::exception`. - `_ZSt26_Throw_bad_optional_accessv_nid_postfix()` throwing through `ThrowPlain`. - `what()` returning `"bad_optional_access"`, matching Dinkumware / libc++ conventions. - Unit test coverage in `ExceptionRuntime.cpp` verifying the exception is caught as `std::bad_optional_access`. Fixes part of #7624. ### Tested Windows 11, MinGW-w64 GCC 15.2.0 (Release). Verified build and test in `ExceptionRuntime.cpp`. ### 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`); silent stubs are listed under Silent stubs in their library's technical 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: none - [x] Fixes: none - [x] Unblocks: PPSA26578 #7624 - [x] GPUs tested: n/a - [x] AI-assisted: no ``` *(If AI assistance was used, adjust `AI-assisted` to `yes`)*.
MarcZX10 commented 2026-10-19 12:57:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T12:57:26Z.


Heads-up: open PR #6079 already adds the same _ZSt26_Throw_bad_optional_accessv export (NID KwzEip7m6TM) and exception type/vtable in core/libs/prx/libc/src/exception/StandardExceptions.cpp. This PR overlaps that implementation, although it adds a regression case for PPSA26578. Please coordinate with #6079’s author/maintainers on which implementation and tests should proceed; the two PRs currently also use different what() strings, which would need a single verified choice.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6267749812 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7872#issuecomment-6267749812). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T12:57:26Z. --- Heads-up: open PR #6079 already adds the same `_ZSt26_Throw_bad_optional_accessv` export (NID `KwzEip7m6TM`) and exception type/vtable in `core/libs/prx/libc/src/exception/StandardExceptions.cpp`. This PR overlaps that implementation, although it adds a regression case for PPSA26578. Please coordinate with #6079’s author/maintainers on which implementation and tests should proceed; the two PRs currently also use different `what()` strings, which would need a single verified choice.
ErenYeager1836 commented 2026-10-19 13:44:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ErenYeager1836 on 2026-10-19T13:44:16Z.


Thanks for the review and heads-up @MarcZX10!

Regarding the what() string: on PR #6079, @adriadam10 requested changes specifically asking to use libc++'s "bad_optional_access" (matching the neighboring bad_variant_access and bad_weak_ptr in AnyPS5) and to document under technical debt if unverified on hardware. This PR implements that exact libc++ string "bad_optional_access" and documents it in docs/dev/debt/libc.md.

Also updated the PR description with the required ### Checklist and ### Tested sections; all CI checks are now passing green. Happy to coordinate or adapt as maintainers prefer!

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6268695182 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7872#issuecomment-6268695182). Originally posted by [ErenYeager1836](https://github.com/ErenYeager1836) on 2026-10-19T13:44:16Z. --- Thanks for the review and heads-up @MarcZX10! Regarding the `what()` string: on PR #6079, @adriadam10 requested changes specifically asking to use libc++'s `"bad_optional_access"` (matching the neighboring `bad_variant_access` and `bad_weak_ptr` in AnyPS5) and to document under technical debt if unverified on hardware. This PR implements that exact libc++ string `"bad_optional_access"` and documents it in `docs/dev/debt/libc.md`. Also updated the PR description with the required `### Checklist` and `### Tested` sections; all CI checks are now passing green. Happy to coordinate or adapt as maintainers prefer!
MarcZX10 commented 2026-10-19 15:30:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T15:30:11Z.


Thanks for explaining the libc++ string choice and updating the PR description. One remaining accuracy point: the new technical-debt entry says bad_optional_access matches Dinkumware/libc++ conventions, but it does not explicitly say the console libc.prx string is unverified. The review on #6079 asked for that limitation to be recorded when title evidence is unavailable. Please add that clarification.

The overlap with #6079 also remains: both PRs define _ZSt26_Throw_bad_optional_accessv_nid_postfix, while #6079 additionally adds the exception type, constructors, destructor and what() exports. Please coordinate with its author or maintainers on one source of truth before either version merges.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6270946569 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7872#issuecomment-6270946569). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T15:30:11Z. --- Thanks for explaining the libc++ string choice and updating the PR description. One remaining accuracy point: the new technical-debt entry says `bad_optional_access` matches Dinkumware/libc++ conventions, but it does not explicitly say the console `libc.prx` string is unverified. The review on #6079 asked for that limitation to be recorded when title evidence is unavailable. Please add that clarification. The overlap with #6079 also remains: both PRs define `_ZSt26_Throw_bad_optional_accessv_nid_postfix`, while #6079 additionally adds the exception type, constructors, destructor and `what()` exports. Please coordinate with its author or maintainers on one source of truth before either version merges.
ErenYeager1836 commented 2026-10-19 15:51:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ErenYeager1836 on 2026-10-19T15:51:02Z.


Thanks @MarcZX10!

  1. Clarified technical debt: Updated docs/dev/debt/libc.md to explicitly record that the console libc.prx string is unverified:

    ...returning the what() string bad_optional_access matching Dinkumware and libc++ conventions; the console libc.prx string is unverified.

  2. Consolidated with #6079: Added the full exception type, constructors (_ZNSt19bad_optional_accessC1Ev, C2Ev), destructors (D1Ev, D2Ev, D0Ev), and what() exports in StandardExceptions.cpp, along with GuestBadOptionalAccess.cpp which validates the type record, vtable, construction, destruction, and pins what() to "bad_optional_access" (addressing the review feedback on #6079). This unblocks both PPSA26578 (#7624) and PPSA34015 (#6079), making this PR a single comprehensive implementation.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6271321131 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7872#issuecomment-6271321131). Originally posted by [ErenYeager1836](https://github.com/ErenYeager1836) on 2026-10-19T15:51:02Z. --- Thanks @MarcZX10! 1. **Clarified technical debt**: Updated `docs/dev/debt/libc.md` to explicitly record that the console `libc.prx` string is unverified: > `...returning the what() string bad_optional_access matching Dinkumware and libc++ conventions; the console libc.prx string is unverified.` 2. **Consolidated with #6079**: Added the full exception type, constructors (`_ZNSt19bad_optional_accessC1Ev`, `C2Ev`), destructors (`D1Ev`, `D2Ev`, `D0Ev`), and `what()` exports in `StandardExceptions.cpp`, along with `GuestBadOptionalAccess.cpp` which validates the type record, vtable, construction, destruction, and pins `what()` to `"bad_optional_access"` (addressing the review feedback on #6079). This unblocks both PPSA26578 (#7624) and PPSA34015 (#6079), making this PR a single comprehensive implementation.
oneandonlydean commented 2026-10-19 18:21:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-19T18:21:52Z.


Thanks @ErenYeager1836. Merging this one: it carries the std::bad_optional_access exports and test from #6079 by @notaxeltv, plus the change @adriadam10 asked for there (what() returns "bad_optional_access", and the debt note says the PS5 string is unverified). Credit for the original implementation and test goes to @notaxeltv. Full CI is green on e775e456d8 (guest_bad_optional_access passes on Linux and Windows, exception_runtime on Linux).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6274198082 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7872#issuecomment-6274198082). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-19T18:21:52Z. --- Thanks @ErenYeager1836. Merging this one: it carries the `std::bad_optional_access` exports and test from #6079 by @notaxeltv, plus the change @adriadam10 asked for there (`what()` returns `"bad_optional_access"`, and the debt note says the PS5 string is unverified). Credit for the original implementation and test goes to @notaxeltv. Full CI is green on e775e456d8 (`guest_bad_optional_access` passes on Linux and Windows, `exception_runtime` on Linux).
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!7872
No description provided.