Repository navigation
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Change: Feature Merge Risk:
|
ligmaSec
left a comment
There was a problem hiding this comment.
guest_dynamic_cast and guest_standard_exception_type_records passed with c50badfe1e integrated on Linux. The new dynamic-cast rows cover the three exported type records, the public virtual base, and downcasts through both basic_ios<char> and ios_base. The retail firmware layouts remain unverified, as recorded in the debt fragment.
AI-assisted: yes.
|
Linux check at head Setup: Linux 7.3.6, Release build of the PR merged onto current AI-assisted: yes |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
Changes are required before merge: cast the class type-info function pointer to const void* when initializing the new record.
What I ran
Reviewed head c50badfe1ed757261f954f6fe02247c87fb4937d by inspecting the prepared review artifacts and using the pinned repo_read.py reader for source context. No build or tests were run.
sed -n '1,200p' description.md
cat manifest.json diff.patch files.json
python3 repo_read.py search 'MultipleTypeRecord'
python3 repo_read.py cat core/libs/prx/libc/include/Api.hpp 90 125
python3 repo_read.py cat core/libs/prx/libc/src/exception/TypeInfo.cpp 1 98
python3 repo_read.py cat core/libs/prx/libc/src/exception/Runtime.cpp 250 420
Read the full prepared text for core/libs/prx/libc/src/exception/TypeInfo.cpp, core/libs/tests/GuestDynamicCast.cpp, and docs/dev/debt/changes/feat-libc-input-stream-rtti.md. files.json lists all three as reviewed and none as excluded.
Results
| Check | Result | Note |
|---|---|---|
| Diff and source review | failed | Found a compile-time type mismatch |
| Build and tests | not run | No compilation or execution performed |
Negative control
Not run; no test was executed or modified.
Findings
Blocking
core/libs/prx/libc/src/exception/TypeInfo.cpp:291initializesFundamentalTypeRecord::vtable, which isconst void*, directly from thedestroyfunction pointer. This function pointer does not implicitly convert to an object pointer in this initializer, so the changed translation unit will fail to compile. The neighboring fundamental type records use an explicitreinterpret_cast<const void*>for the same conversion. Apply that cast here as well.
Non-blocking
None.
Sources
- The new initializer and the record field type are visible in the pinned TypeInfo.cpp source and changed initializer.
Not verified
- The build and tests reported in the PR description were not independently run.
- The SDK comparison and Azahar startup report were not independently verified.
To get this to a good state
Cast the function pointer in the new initializer to const void*, then rerun the reported build and relevant RTTI tests on the new head.
|
@mihai1859 I read this at c50badf. An open review on the head asks for a |
Plyxen
left a comment
There was a problem hiding this comment.
Verified on Windows 11 with WinLibs GCC 15.2.0 r7 (Release). I applied the diff of c50badfe1e to main 63b98e5bf8, together with #28804 and #28844 (neither touches libc).
guest_dynamic_castandguest_standard_exception_type_recordspass with the change. No negative control: the new checks name the new records, so the test does not link without them.- I read the three records against the Itanium C++ ABI and libc++'s declarations:
ios_baseis a root class, so a plain__class_type_infois right.basic_ios<char>has one public non-virtual base at offset 0, so__si_class_type_infois right.basic_istream<char>derivesvirtual public basic_ios, so__vmi_class_type_infowith flags 0, one base, and__offset_flagsof(-3 * sizeof(void*)) << 8 | __virtual_mask | __public_maskis right. That is the vtable slot of the virtual-base offset, the one just before offset-to-top and the type pointer, which is where GCC and Clang put the only virtual base.
- No other file in
core/defines these three symbols.
Not run: Linux, macOS, a title.
AI-assisted: yes (Claude Code)
What
Expose the narrow libc++ type records for
ios_base,basic_ios<char>, andbasic_istream<char>. The records model the root class, the single public base ofbasic_ios, and the public virtual base ofbasic_istreamusing the existing Itanium RTTI runtime. The virtual-base offset comes from the PS5 SDK type record.Tested
Windows 11 x64 with MinGW GCC 16.2.0.
guest_dynamic_castandguest_standard_exception_type_recordspassed. The new cases check all three record names, the two base relationships, and downcasts from both base types.Compared the record sizes, base references, and virtual-base flags against
ios.instantiations.cpp.oandios.cpp.oin the pinned SDK. PS5 Payload SDK v0.42The Windows
libc.prxexports all three records. An isolated Azahar startup with the same test stack resolved thebasic_istream<char>import, dropping the count from 140 to 139. RetroArch trackerThe final branch head passed the same tests on a combined Windows build based on main 2bf6ec6. Startup resolved the same input-stream type record. The rest of the 140 to 132 change came from #28728 and the separate file-buffer close patch.
Checklist
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)Summary by CodeRabbit