* do not eat the semicolon after an absolute expression to a symbol, noted in #40978

This commit is contained in:
florian 2024-10-30 22:45:48 +01:00
parent b28681e91d
commit b7edddf9d9
2 changed files with 21 additions and 1 deletions

View File

@ -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 }

21
tests/webtbs/tw40978.pp Normal file
View File

@ -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.