From b7edddf9d9274c827cfae90b610d84cd0f5ad7ba Mon Sep 17 00:00:00 2001 From: florian Date: Wed, 30 Oct 2024 22:45:48 +0100 Subject: [PATCH] * do not eat the semicolon after an absolute expression to a symbol, noted in #40978 --- compiler/pdecvar.pas | 1 - tests/webtbs/tw40978.pp | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 tests/webtbs/tw40978.pp diff --git a/compiler/pdecvar.pas b/compiler/pdecvar.pas index 0a9c9e7c48..0a99a5842f 100644 --- a/compiler/pdecvar.pas +++ b/compiler/pdecvar.pas @@ -1214,7 +1214,6 @@ implementation abssym.asmname:=stringdup(strpas(tstringconstnode(pt).value_str)) else abssym.asmname:=stringdup(chr(tordconstnode(pt).value.svalue)); - consume(token); abssym.abstyp:=toasm; end { address } diff --git a/tests/webtbs/tw40978.pp b/tests/webtbs/tw40978.pp new file mode 100644 index 0000000000..0e80164467 --- /dev/null +++ b/tests/webtbs/tw40978.pp @@ -0,0 +1,21 @@ +program Project1; + +var + aa: integer public name 'aa'; + +procedure foo(bar: integer); +var x: integer absolute 'aa'; +begin + if x<>1234 then + halt(1); + x := 2; + x := bar; + writeln(x); +end; + +begin + aa:=1234; + foo(1); + if aa<>1 then + halt(1); +end.