瀏覽代碼

* add no internal flag when folding constants in taddnode.simplify, resolves #39308

florian 3 年之前
父節點
當前提交
00d4a6889d
共有 2 個文件被更改,包括 11 次插入2 次删除
  1. 0 2
      compiler/nadd.pas
  2. 11 0
      tests/webtbf/tw39308.pp

+ 0 - 2
compiler/nadd.pas

@@ -788,8 +788,6 @@ implementation
                else
                  internalerror(2008022101);
              end;
-             if not forinline then
-               include(t.flags,nf_internal);
              result:=t;
              exit;
           end

+ 11 - 0
tests/webtbf/tw39308.pp

@@ -0,0 +1,11 @@
+{ %fail }
+{ %opt=-Sew }
+program project1;
+var
+  a: byte;
+begin
+  a:=1;
+  if 1 > 2 then
+    a := 0;         // <= no warning
+  writeln(a);
+end.