mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 01:09:27 +02:00
+ new bug with range checks
This commit is contained in:
parent
d82e73e3f1
commit
f9306d5210
35
bugs/bug0236.pp
Normal file
35
bugs/bug0236.pp
Normal 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.
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user