* records containing managed types are not "regable", resolves #21674

git-svn-id: trunk@20753 -
This commit is contained in:
florian 2012-04-07 20:19:48 +00:00
parent 66b0f3d9fb
commit dd70debe80
3 changed files with 27 additions and 1 deletions

1
.gitattributes vendored
View File

@ -12314,6 +12314,7 @@ tests/webtbs/tw2159.pp svneol=native#text/plain
tests/webtbs/tw21592.pp svneol=native#text/pascal
tests/webtbs/tw21593.pp svneol=native#text/pascal
tests/webtbs/tw2163.pp svneol=native#text/plain
tests/webtbs/tw21674.pp svneol=native#text/pascal
tests/webtbs/tw2176.pp svneol=native#text/plain
tests/webtbs/tw2177.pp svneol=native#text/plain
tests/webtbs/tw2178.pp svneol=native#text/plain

View File

@ -1430,7 +1430,8 @@ implementation
recsize:=size;
is_intregable:=
ispowerof2(recsize,temp) and
(recsize <= sizeof(asizeint));
(recsize <= sizeof(asizeint))
and not needs_inittable;
end;
end;
end;

24
tests/webtbs/tw21674.pp Normal file
View File

@ -0,0 +1,24 @@
{$optimization on}
program Project1;
{$mode objfpc}{$H+}
type
TMyArray = record
Stuff: array of Longword;
end;
Var
MyArray: TMyArray;
I: Integer;
procedure WriteNumbers(A: TMyArray);
begin
for I := 0 to High(A.Stuff) do WriteLn(A.Stuff[I]);
end;
begin
SetLength(MyArray.Stuff, 100);
for I := 0 to High(MyArray.Stuff) do MyArray.Stuff[I] := I;
WriteNumbers(MyArray);
end.