This stack overflow occurs because you are creating a very large local variable poly
(of 1.073.741.828 bytes ¡¡¡¡) and the stack (the place where the local variables are stored) has a limited size.
You can avoid this issue redeclarating your types in this way
PCArray=^Tcarray;
Tcarray=array[1..$04000000] of Tcoordinate;
Tpoly=packed record
n:longint;
c:PCArray;
end;
And use like so
var
poly : Tpoly; //now poly only uses 8 bytes of the stack space
points : integer;
begin
points:=5;
GetMem(poly.c,sizeof(Tcoordinate)*points);
try
with poly do
begin
c[1].x:=100; c[1].y:=100;
c[2].x:=400; c[2].y:=100;
c[3].x:=400; c[3].y:=400;
c[4].x:=250; c[4].y:=550;
c[5].x:=100; c[5].y:=400;
n:=points;
end;
finally
FreeMem(poly.c);
end;
end;