瀏覽代碼

* fixed inlining of functions called in their own parameters (tw1623)

git-svn-id: trunk@5389 -
Jonas Maebe 18 年之前
父節點
當前提交
248046320a
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      compiler/ncal.pas

+ 6 - 1
compiler/ncal.pas

@@ -2348,7 +2348,12 @@ implementation
                 n := para.left.getcopy;
                 n := para.left.getcopy;
                 para.left.free;
                 para.left.free;
                 para.left := n;
                 para.left := n;
-                firstpass(para.left);
+                { not pass_1, because if that para is a function call to  }
+                { this same function, then it will be inlined again since }
+                { po_inline is not yet unset (since set_resulttype needs  }
+                { it to determine whether the resulttype location may be  }
+                { changed)                                                }
+                typecheckpass(para.left);
 
 
                 { create temps for value parameters, function result and also for    }
                 { create temps for value parameters, function result and also for    }
                 { const parameters which are passed by value instead of by reference }
                 { const parameters which are passed by value instead of by reference }