[fpc-pascal] type Ta = 1..10; var a : Ta; // a not initialized = crash

Skybuck Flying skybuck2000 at hotmail.com
Sat Sep 22 07:04:21 CEST 2007


Hello,

The following program compiled with free pascal 1.0.8 crashes:

type
  Ta = 1..10;
  Tb = 1..5;
var
  a : Ta;
  b : Tb;
begin
//  a := 1; // uncommenting these lines leads to crash.
//  b := 2;
  a := b;
  writeln( a );
  writeln('test');
  readln;

end.

(Also tested it in Delphi 2007, does not crash there. It seems Delphi 2007 
initializes these special types to zero, or maybe it was a fluke of luck 
;) )

Bye,
  Skybuck.




More information about the fpc-pascal mailing list