From 61d86150aad4475ae6d6036b65f3ac3642b24bcf Mon Sep 17 00:00:00 2001 From: florian Date: Mon, 17 Apr 2006 08:25:44 +0000 Subject: [PATCH] * interface wrappers for win64 abi fixed git-svn-id: trunk@3240 - --- compiler/x86_64/cgcpu.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/x86_64/cgcpu.pas b/compiler/x86_64/cgcpu.pas index 0e27e0d4a5..2f330ddc2e 100644 --- a/compiler/x86_64/cgcpu.pas +++ b/compiler/x86_64/cgcpu.pas @@ -125,8 +125,12 @@ unit cgcpu; begin if (procdef.extnumber=$ffff) then Internalerror(200006139); - { mov 0(%rdi),%rax ; load vmt} - reference_reset_base(href,NR_RDI,0); + { load vmt from first paramter } + { win64 uses a different abi } + if target_info.system=system_x86_64_win64 then + reference_reset_base(href,NR_RCX,0) + else + reference_reset_base(href,NR_RDI,0); cg.a_load_ref_reg(list,OS_ADDR,OS_ADDR,href,NR_RAX); { jmp *vmtoffs(%eax) ; method offs } reference_reset_base(href,NR_RAX,procdef._class.vmtmethodoffset(procdef.extnumber));