feat(libc): implement std::__throw_bad_weak_ptr #1240

Closed
emirplus wants to merge 1 commit from upstream-pr/1240 into main
emirplus commented 2026-10-07 19:08:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by emirplus on 2026-10-07T19:08:03Z.


Resolves NID BnMAMrsfVWo (_ZSt19_Throw_bad_weak_ptrv) by implementing std::bad_weak_ptr.

Changes

  • core/libs/prx/libc/src/exception/StandardExceptions.cpp: add _ZTISt12bad_weak_ptr, _ZTVSt12bad_weak_ptr, destructors D0/D1/D2, constructors C1/C2, what() and _ZSt19_Throw_bad_weak_ptrv, following the pattern of bad_function_call and bad_alloc; add St12bad_weak_ptr to PlainWhat so what() returns the readable string.
  • core/libs/prx/libc/src/HeapDiagnostics.cpp: remove the obsolete unknown stub.
  • core/libs/tests/ExceptionRuntime.cpp: add assertion that _ZSt19_Throw_bad_weak_ptrv_nid_postfix throws catchable as std::exception with what() returning std::bad_weak_ptr.
  • docs/dev/TechnicalDebt.md: remove resolved BnMAMrsfVWo entry.

Verification

NID confirmed by SHA-1 of _ZSt19_Throw_bad_weak_ptrv with project suffix: BnMAMrsfVWo.

Windows build (cmake --build --target libc -j 8): no warnings, no errors.

guest_errors test: passed.

exception_runtime_tests (Linux CI) will verify the new assertion.

AI-assisted

AI-assisted: yes

Co-Authored-By: Gemini 3.8 Flash [email protected]

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4777222866 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1240). Originally posted by [emirplus](https://github.com/emirplus) on 2026-10-07T19:08:03Z. --- Resolves NID BnMAMrsfVWo (_ZSt19_Throw_bad_weak_ptrv) by implementing std::bad_weak_ptr. ## Changes - `core/libs/prx/libc/src/exception/StandardExceptions.cpp`: add `_ZTISt12bad_weak_ptr`, `_ZTVSt12bad_weak_ptr`, destructors D0/D1/D2, constructors C1/C2, `what()` and `_ZSt19_Throw_bad_weak_ptrv`, following the pattern of `bad_function_call` and `bad_alloc`; add St12bad_weak_ptr to PlainWhat so what() returns the readable string. - `core/libs/prx/libc/src/HeapDiagnostics.cpp`: remove the obsolete unknown stub. - `core/libs/tests/ExceptionRuntime.cpp`: add assertion that `_ZSt19_Throw_bad_weak_ptrv_nid_postfix` throws catchable as `std::exception` with what() returning `std::bad_weak_ptr`. - `docs/dev/TechnicalDebt.md`: remove resolved BnMAMrsfVWo entry. ## Verification NID confirmed by SHA-1 of `_ZSt19_Throw_bad_weak_ptrv` with project suffix: BnMAMrsfVWo. Windows build (cmake --build --target libc -j 8): no warnings, no errors. guest_errors test: passed. exception_runtime_tests (Linux CI) will verify the new assertion. ## AI-assisted AI-assisted: yes Co-Authored-By: Gemini 3.8 Flash <[email protected]>
github-actions[bot] commented 2026-10-08 02:18:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-08T02:18:51Z.


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
#1391 core/libs/prx/libc/src/exception/StandardExceptions.cpp L291
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6050830310 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1240#issuecomment-6050830310). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-08T02:18:51Z. --- <!-- 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 | |---|---|---|---| | #1391 | `core/libs/prx/libc/src/exception/StandardExceptions.cpp` [L291](https://github.com/boykopovar/AnyPS5/blob/9619edff7251271ad5ef2f23263ae00ccf88e35b/core/libs/prx/libc/src/exception/StandardExceptions.cpp#L291) | | |
oneandonlydean commented 2026-10-08 02:44:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-08T02:44:38Z.


Closing: #1143 adds the same std::bad_weak_ptr exports and was opened first. If something here is missing from it, please comment on #1143 with what it misses.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6051106502 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1240#issuecomment-6051106502). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-08T02:44:38Z. --- Closing: #1143 adds the same `std::bad_weak_ptr` exports and was opened first. If something here is missing from it, please comment on #1143 with what it misses.

Pull request closed

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!1240
No description provided.