Browse Source

* fixed calldef specified in case of calling a varargs C function

git-svn-id: branches/hlcgllvm@28494 -
Jonas Maebe 11 years ago
parent
commit
b710220a5e
1 changed files with 5 additions and 1 deletions
  1. 5 1
      compiler/llvm/hlcgllvm.pas

+ 5 - 1
compiler/llvm/hlcgllvm.pas

@@ -409,7 +409,11 @@ implementation
        ((pd.proccalloption in cdecl_pocalls) and
         (pd.paras.count>0) and
         is_array_of_const(tparavarsym(pd.paras[pd.paras.count-1]).vardef)) then
-      calldef:=pd
+      if (pd.typ=procdef) or
+         not pd.is_addressonly then
+        calldef:=pd.getcopyas(procvardef,pc_address_only)
+      else
+        calldef:=pd
     else
       calldef:=llvmretdef;
   end;