* set rangedef of dyn. arrays correctly, resolves #40149

This commit is contained in:
florian 2023-02-15 22:14:35 +01:00
parent 11cf24891d
commit 811c683775
2 changed files with 19 additions and 1 deletions

View File

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