aarch64-win64: pass const method pointer and nested procvar parameters by reference. Fixes #41610

Summary

Commit 0430e1bd added a special case to pass all const record parameters by reference on aarch64-win64. However, procvardef types (method pointers and nested procedure variables) were not covered, even though they are also 16-byte composite types (Code + Data pointers).

This causes a calling convention mismatch when the generics system bridges between TMethod (recorddef, by reference) and a method pointer type like TMyMethod (procvardef, by value) through a VMT.

Fix

Added a procvardef case to push_addr_param in compiler/aarch64/cpupara.pas that mirrors the existing recorddef logic.

Test

TTestStdCollections.Test_MethodsList from the rtl-generics test suite now passes on aarch64-win64.

Fixes #41610

Merge request reports

Loading