diff --git a/.gitattributes b/.gitattributes index d0a5a8e819..009da14dbe 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/compiler/symdef.pas b/compiler/symdef.pas index bb236e501a..e36a2c21d7 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -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; diff --git a/tests/webtbs/tw21674.pp b/tests/webtbs/tw21674.pp new file mode 100644 index 0000000000..c9b93f4f84 --- /dev/null +++ b/tests/webtbs/tw21674.pp @@ -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.