Repository navigation
fix(libSceNKWebKit): return a reference from ISOBox::boxType - #24651
Conversation
boxType() is in the 3.20 inventory only. In the WebKit of that module it is declared const FourCC& boxType() const, so the caller receives the address of m_boxType and reads the code through it. The port returned the 32-bit value itself, which is what the later revision's FourCC boxType() const does; a 3.20 caller would have used that value as a pointer. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — comments
The changed accessor and its test implement the stated reference return; the review bundle reports successful Windows tests, but I did not run them.
What I ran
Reviewed head 97276f896c8af766d2dea600be5c18c81ab1cc0a. No commands or tests were run; the prepared bundle and repository reader were used to inspect the change.
Results
| Check | Result | Note |
|---|---|---|
| Changed source review | passed | Four changed files read |
| Tests and prechecks | not run | Results are author-reported |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The reported test runs, negative controls, prechecks, PR overlap check, and merge-tree checks were not independently verified. No changed files were excluded; files.json was unavailable, so exclusions by rule are not verified.
To get this to a good state
Nothing is required.
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 97276f896c:
- Conventions:
tools/check_conventions.pypassed. - Build:
nkwebkit_isoboxaccessors_testsbuilt cleanly. - CTest (
nkwebkit_isoboxaccessors):1/1 Test #4759: nkwebkit_isoboxaccessors ......... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
core/libs/prx/libSceNKWebKit/include/IsoBoxExports.hpp,core/libs/prx/libSceNKWebKit/src/IsoBoxAccessors.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass. - Code reading:
- Verified that ISOBox::boxType export signature matches WebKit 3.20 const FourCC& return type, returning const std::uint32_t* to match pointer/reference ABI in IsoBoxExports.hpp and IsoBoxAccessors.cpp.
- Checked null-pointer verification in Checked(self, "ISOBox::boxType"), throwing std::invalid_argument when self is null.
- Confirmed LP64 and LLP64 ABI compatibility for uint32_t pointer return across Linux and Windows GCC.
- Verified technical debt documentation fragment docs/dev/debt/changes/fix-nkwebkit-iso-box-type-reference.md adheres to the required format and accurately describes the 3.20 inventory gap.
- Audited IsoBoxAccessors.cpp test case in core/libs/prx/libSceNKWebKit/tests/IsoBoxAccessors.cpp for offset check (+16 bytes), pointer identity, and value mutability reflection.
Looks Good To Me
What
ISOBox::boxType()returned the box's four-character code by value. In the module that exports it, it returns a reference.The export is in the 3.20 inventory only. In the WebKit of that module the class is
WEBCORE_EXPORTand the accessor is declared (ISOBox.h L51):so the caller receives the address of
m_boxTypeand reads the code through it. The port followed the later revision, where the same accessor isFourCC boxType() constand the 32-bit value comes back in the register. A 3.20 caller would have taken that value, for example0x7363686d, for a pointer and dereferenced it.The export now returns
&m_boxType, which is 16 bytes into the box (vtable pointer, 64-bit size, then the code).ISOBox.his identical on 2020-06-13 (WebKit34fe4d7c1658) and 2020-11-12 (9fd169d0da68), the window the 3.20 names allow.The other 3.20 accessors of this class were checked against the same header and are unchanged:
size()returns the 64-bit value,extendedType()already returns a reference.Tested
Windows 11, MinGW GCC 15.2.
nkwebkit_isoboxaccessorspasses: the returned pointer is the address of the field, it is 16 bytes from the start of the box, the code is read through it, and a later write to the field is visible through the same pointer.maindoes, and returning the address of the size field.nkwebkit_*tests andpatched_librariespass on the branch.python tools/check_conventions.py --base origin/mainandpython tools/debt_fold.py --checkpass.Not tested on a console.
Overlap (
python tools/pr_overlap.py --branch fix/nkwebkit-iso-box-type-reference): no overlap with open pull requests.It merges cleanly (
git merge-tree) with the open PRs that work on the same files: #24534, mine, which fixes two other 3.20 getters inIsoBoxAccessors.cpp, and #22480, #22481 and #22482, which implement the ISO box parsers; none of them mentionsboxType.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)