Loading
Skip generic methods in the legacy VMT method table (Fixes #41410)
Summary
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.
Fixes #41410. Test: tests/webtbs/tw41410.pp.
System
- Operating system: all (verified on Windows 11)
- Processor architecture: all (verified on x86-64)
- Device: Computer
What is the current bug behavior?
Linking fails:
tw41410.pp(44,1) Error: Undefined symbol: P$TW41410$_$TCONTAINER_$__$$_TEST$1$T (first seen in tw41410.o)What is the behavior after applying this patch?
The program links and runs (exit 0); the published method table lists the non-generic methods only.
Relevant logs and/or screenshots
Verified on x86_64-win64 main (2efddc1b): red before, green after. Also proposed to Unleashed Pascal as PR #41, which waits for this MR.