Byte Comparison Causes PAS2 of Pascal Version 3.20 to Hang

Product Version(s): 3.20
Operating System:   MS-DOS
Flags: ENDUSER | TAR17016 buglist3.20 fixlist3.30
Last Modified:  3-OCT-1988    ArticleIdent: Q10378

Problem:

This problem involves byte comparisons and common subexpressions,
i.e., if one of the elements of the comparison ends up in an index
register because of an earlier subexpression, PAS2 would infinitely
loop. The following program hangs in PAS2:

SHORT EXAMPLE CODE:

   PROGRAM TEST(INPUT,OUTPUT);
   CONST UC_A=ORD('A');
   UC_Z=ORD('Z');
   VAR BUFF : ARRAY[0..255] OF CHAR;
   I, N : INTEGER;
   BEGIN
   FOR I:=UC_A TO UC_Z DO
   IF BUFF[I] <> CHR(I) THEN
   N:=SUCC(N);
   IF I<>N THEN
   N:=SUCC(N)
   END.

Response:

If an ORD function is added to the buff[i] in the comparison, the
program compiles.

Microsoft has confirmed this to be a problem in Version 3.20. This
problem was corrected in Version 3.30.
