瀏覽代碼

+ calculate node complexity for addrnodes and labelnodes

git-svn-id: trunk@24358 -
florian 12 年之前
父節點
當前提交
18aaeff1d7
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      compiler/nutils.pas

+ 8 - 0
compiler/nutils.pas

@@ -589,6 +589,7 @@ implementation
                     exit;
                   p := tunarynode(p).left;
                 end;
+              labeln,
               blockn,
               callparan:
                 p := tunarynode(p).left;
@@ -600,6 +601,13 @@ implementation
                     exit;
                   p := tunarynode(p).left;
                 end;
+              addrn:
+                begin
+                  inc(result);
+                  if (result = NODE_COMPLEXITY_INF) then
+                    exit;
+                  p := tunarynode(p).left;
+                end;
               typeconvn:
                 begin
                   { may be more complex in some cases }