瀏覽代碼

* better complexity calculation of tvecnodes

git-svn-id: trunk@47151 -
florian 4 年之前
父節點
當前提交
6fc930a0fc
共有 1 個文件被更改,包括 11 次插入1 次删除
  1. 11 1
      compiler/nutils.pas

+ 11 - 1
compiler/nutils.pas

@@ -872,7 +872,17 @@ implementation
                     exit;
                   p := tunarynode(p).left;
                 end;
-              vecn,
+              vecn:
+                begin
+                  inc(result,node_complexity(tbinarynode(p).left));
+                  inc(result);
+                  if (result >= NODE_COMPLEXITY_INF) then
+                    begin
+                      result := NODE_COMPLEXITY_INF;
+                      exit;
+                    end;
+                  p := tbinarynode(p).right;
+                end;
               statementn:
                 begin
                   inc(result,node_complexity(tbinarynode(p).left));