浏览代码

* do not throw a warning about unreachable code if the responsible node was generated internally

git-svn-id: trunk@44051 -
florian 5 年之前
父节点
当前提交
1486ab7c70
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      compiler/nflw.pas

+ 3 - 2
compiler/nflw.pas

@@ -1293,6 +1293,7 @@ implementation
          if (lnf_testatbegin in loopflags) and
             (left.nodetype=ordconstn) and
             (tordconstnode(left).value.uvalue=0) and
+            not(nf_internal in left.flags) and
             assigned(right) then
            CGMessagePos(right.fileinfo,cg_w_unreachable_code);
       end;
@@ -1556,7 +1557,7 @@ implementation
                   else
                     result:=cnothingnode.create;
                   right:=nil;
-                  if warn and assigned(t1) then
+                  if warn and assigned(t1) and not(nf_internal in left.flags) then
                     CGMessagePos(t1.fileinfo,cg_w_unreachable_code);
                end
              else
@@ -1566,7 +1567,7 @@ implementation
                   else
                     result:=cnothingnode.create;
                   t1:=nil;
-                  if warn and assigned(right) then
+                  if warn and assigned(right) and not(nf_internal in left.flags) then
                     CGMessagePos(right.fileinfo,cg_w_unreachable_code);
                end;
           end;