From 00d4a6889dd2f79981ebaef3f839be5354d2933c Mon Sep 17 00:00:00 2001 From: florian Date: Tue, 12 Oct 2021 22:59:17 +0200 Subject: [PATCH] * add no internal flag when folding constants in taddnode.simplify, resolves #39308 --- compiler/nadd.pas | 2 -- tests/webtbf/tw39308.pp | 11 +++++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 tests/webtbf/tw39308.pp diff --git a/compiler/nadd.pas b/compiler/nadd.pas index dba7593c7e..ea251ddbc6 100644 --- a/compiler/nadd.pas +++ b/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 diff --git a/tests/webtbf/tw39308.pp b/tests/webtbf/tw39308.pp new file mode 100644 index 0000000000..181294febb --- /dev/null +++ b/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.