2
0
Эх сурвалжийг харах

* set nf_internal for if nodes generated by assert, prevent warning for assert(true); resolves #26467

git-svn-id: trunk@29293 -
florian 10 жил өмнө
parent
commit
c9ba9665dd

+ 1 - 0
.gitattributes

@@ -14133,6 +14133,7 @@ tests/webtbs/tw2631.pp svneol=native#text/plain
 tests/webtbs/tw26408.pp svneol=native#text/pascal
 tests/webtbs/tw26408.pp svneol=native#text/pascal
 tests/webtbs/tw2643.pp svneol=native#text/plain
 tests/webtbs/tw2643.pp svneol=native#text/plain
 tests/webtbs/tw2645.pp svneol=native#text/plain
 tests/webtbs/tw2645.pp svneol=native#text/plain
+tests/webtbs/tw26467.pp svneol=native#text/pascal
 tests/webtbs/tw2647.pp svneol=native#text/plain
 tests/webtbs/tw2647.pp svneol=native#text/plain
 tests/webtbs/tw26482.pp svneol=native#text/pascal
 tests/webtbs/tw26482.pp svneol=native#text/pascal
 tests/webtbs/tw2649.pp svneol=native#text/plain
 tests/webtbs/tw2649.pp svneol=native#text/plain

+ 1 - 0
compiler/ninl.pas

@@ -4117,6 +4117,7 @@ implementation
 {$endif}
 {$endif}
          result:=cifnode.create(cnotnode.create(tcallparanode(left).left),
          result:=cifnode.create(cnotnode.create(tcallparanode(left).left),
             ccallnode.createintern('fpc_assert',paras),nil);
             ccallnode.createintern('fpc_assert',paras),nil);
+         include(result.flags,nf_internal);
          tcallparanode(left).left:=nil;
          tcallparanode(left).left:=nil;
          tcallparanode(left).right:=nil;
          tcallparanode(left).right:=nil;
        end;
        end;

+ 19 - 0
tests/webtbs/tw26467.pp

@@ -0,0 +1,19 @@
+{ %OPT=-Sew}
+{$INLINE ON}
+{$ASSERTIONS ON}
+program test;
+
+procedure TestFunc();
+begin
+   Assert(True);
+end;
+
+procedure TestFuncInline(); inline;
+begin
+   Assert(True);
+end;
+
+begin
+   TestFunc();
+   TestFuncInline(); // Warning: unreachable code
+end.