An attempt to pass fields of a record as variables to a procedure for a record given by a pointer yields compilation error of .a65 file.
For FPC -MDelphi v3.2.2 it works as expected.
Mad-Pascal Compiler version d7619c5
Mad-Assembler version 40bfd80
See also #90
Code to reproduce the issue
uses crt;
type
Point = record x, y: Byte end;
Segment = record a, b: Point end;
SegmentPtr = ^Segment;
var s: Segment;
procedure PrintPoint(var p: Point);
begin
WriteLn(p.x, ' ', p.y);
end;
procedure PrintSegment(sp: SegmentPtr);
begin
PrintPoint(sp^.a);
PrintPoint(sp^.b);
end;
begin
s.a.x := 1; s.a.y := 2;
s.b.x := 3; s.b.y := 4;
PrintSegment(@s);
ReadKey();
end.
Output
Expected
1 2
3 4
Actual
mva :STACKORIGIN,x
test10.a65 (462) ERROR: Unexpected end of line
Issue description
An attempt to pass fields of a record as variables to a procedure for a record given by a pointer yields compilation error of .a65 file. For FPC -MDelphi v3.2.2 it works as expected.
Mad-Pascal Compiler version d7619c5 Mad-Assembler version 40bfd80
See also #90
Code to reproduce the issue
Output
Expected
Actual