Przeglądaj źródła

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

git-svn-id: trunk@5389 -
Jonas Maebe 18 lat temu
rodzic
commit
248046320a
1 zmienionych plików z 6 dodań i 1 usunięć
  1. 6 1
      compiler/ncal.pas

+ 6 - 1
compiler/ncal.pas

@@ -2348,7 +2348,12 @@ implementation
                 n := para.left.getcopy;
                 para.left.free;
                 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    }
                 { const parameters which are passed by value instead of by reference }