mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 18:09:30 +02:00
* set rangedef of dyn. arrays correctly, resolves #40149
This commit is contained in:
parent
11cf24891d
commit
811c683775
@ -1544,7 +1544,7 @@ implementation
|
||||
Message(parser_e_packed_dynamic_open_array);
|
||||
arrdef.lowrange:=0;
|
||||
arrdef.highrange:=-1;
|
||||
arrdef.rangedef:=s32inttype;
|
||||
arrdef.rangedef:=sizesinttype;
|
||||
include(arrdef.arrayoptions,ado_IsDynamicArray);
|
||||
def:=arrdef;
|
||||
end;
|
||||
|
18
tests/webtbs/tw40149.pp
Normal file
18
tests/webtbs/tw40149.pp
Normal file
@ -0,0 +1,18 @@
|
||||
{ %opt=-CO -Seh }
|
||||
{ %norun }
|
||||
program test;
|
||||
|
||||
procedure foo;
|
||||
var
|
||||
i: integer;
|
||||
a: array of integer;
|
||||
begin
|
||||
a := NIL;
|
||||
for i in a do
|
||||
begin
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
foo;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user