diff --git a/compiler/scanner.pas b/compiler/scanner.pas index e888669197..ed6e368c90 100644 --- a/compiler/scanner.pas +++ b/compiler/scanner.pas @@ -2134,11 +2134,13 @@ type begin result.free; result:=texprvalue.create_const(tconstsym(srsym)); + tconstsym(srsym).IncRefCount; end; enumsym: begin result.free; result:=texprvalue.create_int(tenumsym(srsym).value); +// tconstsym(srsym).IncRefCount; end; else ; diff --git a/tests/webtbs/tw40108.pp b/tests/webtbs/tw40108.pp new file mode 100644 index 0000000000..24bf03f296 --- /dev/null +++ b/tests/webtbs/tw40108.pp @@ -0,0 +1,14 @@ +{ %opt=-Seh } +{ %norun } +program test; + +const + TheVersion = 1; + +begin + {$if TheVersion >= 1} + writeln('Version 1 or higher'); + {$else} + writeln('Version < 1'); + {$endif} +end.