Skip to content

rtti: skip generic methods in the legacy VMT method table (fixes upstream#41410) - #41

Open
Moonbot-Tech wants to merge 1 commit into
unleashedpascal:mainfrom
Moonbot-Tech:fix-41410
Open

rtti: skip generic methods in the legacy VMT method table (fixes upstream#41410)#41
Moonbot-Tech wants to merge 1 commit into
unleashedpascal:mainfrom
Moonbot-Tech:fix-41410

Conversation

@Moonbot-Tech

@Moonbot-Tech Moonbot-Tech commented Sep 6, 2026

Copy link
Copy Markdown

Problem. FPC issue #41410: a published open generic method has no callable body, but the legacy method table writer counted it and emitted a reference to the generic template symbol, so a valid {$M+} class failed at link time with an undefined symbol.

Fix. Make the counting and writing predicates in ncgvmt.pas symmetric and exclude tprocdef.is_generic, as the extended RTTI writer already does. Ordinary published methods and real specializations are unaffected.

Test. tests/webtbs/tw41410.pp: link error on current main, runs after the fix.

Validation. Win64 build of main (a359fc1) with the patch; 405 neighbouring tests from tests/test (inline, rtti, helpers, generics, opt) give identical results before and after.

🤖 Generated with Claude Code

…ream#41410)

A published open generic method has no callable body, but the legacy
method table writer still counted it and emitted a reference to the
generic template symbol, so a valid class failed at link time with an
undefined symbol.

Make the counting and writing predicates symmetric and exclude
tprocdef.is_generic, as the extended RTTI writer already does. Ordinary
published methods and real specializations are unaffected.

FPC issue: https://gitlab.com/freepascal.org/fpc/source/-/issues/41410

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@Moonbot-Tech Moonbot-Tech changed the title rtti: skip generic methods in the legacy VMT method table (fixes upst… rtti: skip generic methods in the legacy VMT method table (fixes upstream#41410) Sep 6, 2026
@fibodevy fibodevy added the waiting-upstream Stock FPC fix, waits for the upstream MR to be merged or rejected label Sep 6, 2026
@Moonbot-Tech

Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-upstream Stock FPC fix, waits for the upstream MR to be merged or rejected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants