Browse Source

+ new bug with range checks

pierre 26 years ago
parent
commit
f9306d5210
2 changed files with 36 additions and 0 deletions
  1. 35 0
      bugs/bug0236.pp
  2. 1 0
      bugs/readme.txt

+ 35 - 0
bugs/bug0236.pp

@@ -0,0 +1,35 @@
+program test_set_subrange;
+
+ type
+   enum = (zero,one,two,three);
+
+   sub_enum = one..three;
+   prec = ^trec;
+   
+   trec = record
+     dummy : longint;
+     en : enum;
+     next : prec;
+   end;
+
+ const
+   str : array[sub_enum] of string = ('one','two','three');
+
+procedure test;
+
+ var hp : prec;
+    t : sub_enum;
+ 
+ begin
+   new(hp);
+   hp^.en:=two;
+   new(hp^.next);
+   hp^.next^.en:=three;
+   t:=hp^.en;
+   Writeln('hp^.en = ',str[hp^.en]);
+   Writeln('hp^.next^.en = ',str[hp^.next^.en]);
+ end;
+
+begin
+  test;
+end.

+ 1 - 0
bugs/readme.txt

@@ -319,3 +319,4 @@ bug0232.pp   const. procedure variables need a special syntax
              if they use calling specification modifiers
 bug0234.pp   New with void pointer
 bug0235.pp   Val(cardinal) bug
+bug0236.pp   Problem with range check of subsets !! compile with -Cr