Skip to content

fix(tests): drop const before casting the NpTitleSecret deleting destructor slot - #15756

Closed
imellag wants to merge 1 commit into
boykopovar:mainfrom
imellag:fix/tests-np-title-secret-vtable-const
Closed

imellag wants to merge 1 commit into
boykopovar:mainfrom
imellag:fix/tests-np-title-secret-vtable-const

Conversation

@imellag

@imellag imellag commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

What

GuestNpCommonRuntime.cpp's NpTitleSecret case (from #13978) calls the deleting destructor through reinterpret_cast<Destructor>(owned->vtable[1]). The vtable slots are const void*, and clang refuses a reinterpret_cast that casts away const, so the test file stops the macOS build:

core/libs/tests/GuestNpCommonRuntime.cpp:531:5: error: reinterpret_cast from 'const void *' to 'Destructor' (aka 'void (*)(NpTitleSecretObject *)') casts away qualifiers

The slot is now taken through const_cast<void*> first, as the other vtable calls in the same file already do (line 475 and the stream reader and writer cases).

Tested

macOS 27.2, Apple M4 Pro, x86-64 Release under Rosetta 2, in the support branch support/macos-boot-1103 merged with main b11c7bf84f (the open macOS port PRs #7631, #7804, #4630, #11437 and local build fixes), with #15700 and #15755 applied. Without this commit the full build stops at line 531; with it the full build goes through, and ctest -R '^(guest_appcontent|guest_np_common_rtc|guest_np_common_state_predicates)' passes 9 of 9.

tools/check_conventions.py --base upstream/main passes. tools/pr_overlap.py merged the 11 PRs sharing the file without overlap; of the three it could not compare, #13270 and #13486 add this same line, and #12852 adds another vtable[1] call on a different object.

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: none
  • GPUs tested: n/a
  • AI-assisted: yes

@JJenkx

JJenkx commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Windows check of head e08c42eecb, which already contains main b11c7bf84f.

Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run this test on pull requests.

  • guest_np_common_runtime passes in 3 of 3 runs.

AI-assisted: yes.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 6, 2026
@imellag

imellag commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Closing: #15699 (javierUDP), merged on 2026-11-05, made the same cast of the NpTitleSecret deleting destructor slot in GuestNpCommonRuntime.cpp, so main builds this test on macOS without this PR.

AI-assisted: yes

@imellag imellag closed this Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rebase Conflicts with main, rebase needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants