소스 검색

* use currpara.paraloc[calleeside].def instead of currpara.vardef when copying parameters to local registers in ncgutil. this mimics hlcgobj behavior and fixes parameters passed by reference to be allocated into intregs on m68k. among others, this has a big impact on OOP code, because of self, for example

git-svn-id: trunk@33707 -
Károly Balogh 9 년 전
부모
커밋
b6242d14ed
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      compiler/ncgutil.pas

+ 3 - 1
compiler/ncgutil.pas

@@ -1308,7 +1308,9 @@ implementation
         for i:=0 to current_procinfo.procdef.paras.count-1 do
           begin
             currpara:=tparavarsym(current_procinfo.procdef.paras[i]);
-            gen_load_cgpara_loc(list,currpara.vardef,currpara.paraloc[calleeside],currpara.initialloc,paramanager.param_use_paraloc(currpara.paraloc[calleeside]));
+            { don't use currpara.vardef, as this will be wrong in case of
+              call-by-reference parameters (it won't contain the pointerdef) }
+            gen_load_cgpara_loc(list,currpara.paraloc[calleeside].def,currpara.paraloc[calleeside],currpara.initialloc,paramanager.param_use_paraloc(currpara.paraloc[calleeside]));
             { gen_load_cgpara_loc() already allocated the initialloc
               -> don't allocate again }
             if currpara.initialloc.loc in [LOC_CREGISTER,LOC_CFPUREGISTER,LOC_CMMREGISTER] then