READs and WRITEs to Binary File Cause Crash in Version 3.31

Product Version(s): 3.31 3.32
Operating System:   MS-DOS
Flags: ENDUSER | TAR52819 buglist3.31 fixlist3.32
Last Modified:  3-OCT-1988    ArticleIdent: Q12402

The program below uses READs and WRITEs to a binary sequential file.
It crashes the system in Version 3.31, but works properly in Version
3.30. If GETs and PUTs are used instead, the program executes
successfully. According to the standard, it is legal to use READs and
WRITEs on a binary sequential file.

Microsoft has confirmed this to be a problem in Version 3.31. This
problem was corrected in Version 3.32.

The following code demonstrates this problem:

{$LINE+}
program test(input,output);
TYPE BUFF=ARRAY[0..511] OF INTEGER;

VAR  BFILE:FILE OF BUFF;
     FNAME:LSTRING(80);
     DATA:BUFF;

     I:INTEGER;
BEGIN
     FNAME:='CU.DAT';
     ASSIGN(BFILE,FNAME);
     REWRITE(BFILE);
     FOR I:=0 TO 511 DO
      DATA[I]:=I;
     WRITE(BFILE,DATA);
     CLOSE(BFILE);

     RESET(BFILE);
     FOR I:=0 TO 511 DO
      DATA[I]:=0;
     READ(BFILE,DATA);
     FOR I:=0 TO 511 DO
      WRITELN(DATA[I]);
     CLOSE(BFILE);
END.