Self put into wrong register if "vectorcall" is used
Original Reporter info from Mantis: CuriousKit @CuriousKit
-
Reporter name: J. Gareth Moreton
Original Reporter info from Mantis: CuriousKit @CuriousKit
- Reporter name: J. Gareth Moreton
Description:
It was reported that if "vectorcall" was used on 64-bit Linux, rather than be silently ignored, it instead put Self into RCX instead of RDI, which should only happen under Win64.
Steps to reproduce:
Apply patch to latest FPC source code to correct the fault.
Additional information:
The fault was an incorrect conditional check in the "x86_64_use_ms_abi" routine. If "vectorcall" was the current calling convention, the result was true no matter what platform was used, and hence in the "thlcgcpu.g_intf_wrapper" method, it set the reference base to RCX instead of RDI on virtual methods.
Mantis conversion info:
- Mantis ID: 33542
- OS: Ubuntu
- OS Build: 16.04
- Build: x86_64-linux
- Platform: Linux 64-bit
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 38663 (#25c5ee2f)