瀏覽代碼

* If parentfp is passed in the stack it can be skipped only if po_delphi_nested_cc is set for the routine.

git-svn-id: trunk@46520 -
yury 5 年之前
父節點
當前提交
e28fca9729
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      compiler/ncgcal.pas

+ 5 - 3
compiler/ncgcal.pas

@@ -143,13 +143,15 @@ implementation
         { We can skip passing the parameter when:
             the parameter can be optimized as unused
             and the target does not strictly require all parameters (has_strict_proc_signature = false)
-            and fixed stack is used
+            and
+                 fixed stack is used
               or the parameter is in a register
-              or the parameter is $parentfp. }
+              or the parameter is $parentfp and po_delphi_nested_cc is set for the routine. }
         result:=paramanager.can_opt_unused_para(parasym) and
           not paramanager.has_strict_proc_signature and
           (paramanager.use_fixed_stack or
-           (vo_is_parentfp in parasym.varoptions) or
+           ((vo_is_parentfp in parasym.varoptions) and
+            (po_delphi_nested_cc in tabstractprocdef(parasym.owner.defowner).procoptions)) or
            (parasym.paraloc[callerside].Location^.Loc in [LOC_REGISTER,LOC_CREGISTER]));
       end;