+ new bug with range checks

This commit is contained in:
pierre 1999-03-25 15:27:52 +00:00
parent d82e73e3f1
commit f9306d5210
2 changed files with 36 additions and 0 deletions

35
bugs/bug0236.pp Normal file
View File

@ -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.

View File

@ -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