Browse Source

+problem with small const sets !

pierre 26 years ago
parent
commit
bab0edbe32
2 changed files with 40 additions and 1 deletions
  1. 39 0
      bugs/bug0258.pp
  2. 1 1
      bugs/readme.txt

+ 39 - 0
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.

+ 1 - 1
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
 bug0246.pp   const para can be changed without error
 bug0252.pp   typecasting not possible within typed const
 bug0252.pp   typecasting not possible within typed const
 bug0255.pp   internal error 10 with in and function calls
 bug0255.pp   internal error 10 with in and function calls
-
+bug0258.pp   bug in small const set extension to large sets