Browse Source

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

florian 9 months ago
parent
commit
b7edddf9d9
2 changed files with 21 additions and 1 deletions
  1. 0 1
      compiler/pdecvar.pas
  2. 21 0
      tests/webtbs/tw40978.pp

+ 0 - 1
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 }

+ 21 - 0
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.