diff --git a/bugs/bug0258.pp b/bugs/bug0258.pp new file mode 100644 index 0000000000..5a013a5712 --- /dev/null +++ b/bugs/bug0258.pp @@ -0,0 +1,39 @@ +program test_set; + +var error : boolean; + + +procedure test; + + var + i : longint; + x : array [1..32] of byte; + + begin + error:=false; + for i:=1 to 32 do x[i]:=$ff; + i:=1; + if i in [1,3,5,8,11,14,15] then + writeln('1 is in [1,3,5,8,11,14,15]') + else + writeln('Error in set'); + i:=135; + if i in [1,3,5,8,11,14,15] then + begin + writeln('Error : 135 is in [1,3,5,8,11,14,15]'); + error:=true; + end; + for i:=1 to 32 do x[i]:=0; + i:=135; + if i in [1,3,5,8,11,14,15] then + writeln('Second try Error : 135 is in [1,3,5,8,11,14,15]') + else + begin + if error then + writeln('Result of 135 in [1,3,5,8,11,14,15] depends on x array !!'); + end; + end; + +begin + test; +end. diff --git a/bugs/readme.txt b/bugs/readme.txt index 7862a8e8b9..f86dcff68f 100644 --- a/bugs/readme.txt +++ b/bugs/readme.txt @@ -350,4 +350,4 @@ bug0245.pp assigning pointers to address of consts is allowed (refused by BP ! bug0246.pp const para can be changed without error bug0252.pp typecasting not possible within typed const bug0255.pp internal error 10 with in and function calls - +bug0258.pp bug in small const set extension to large sets