+ added test (already works)

git-svn-id: trunk@7771 -
This commit is contained in:
Jonas Maebe 2007-06-22 14:38:35 +00:00
parent 84306f80e9
commit ba0d0d4bb8
2 changed files with 50 additions and 0 deletions

1
.gitattributes vendored
View File

@ -8308,6 +8308,7 @@ tests/webtbs/tw9076a.pp svneol=native#text/plain
tests/webtbs/tw9085.pp svneol=native#text/plain
tests/webtbs/tw9098.pp svneol=native#text/plain
tests/webtbs/tw9107.pp svneol=native#text/plain
tests/webtbs/tw9128.pp svneol=native#text/plain
tests/webtbs/ub1873.pp svneol=native#text/plain
tests/webtbs/ub1883.pp svneol=native#text/plain
tests/webtbs/uw0555.pp svneol=native#text/plain

49
tests/webtbs/tw9128.pp Normal file
View File

@ -0,0 +1,49 @@
program BUGGY;
{$MODE delphi}
type
TImageFormat = (ifIndex8, ifA8R8G8B8);
TImageData = packed record
Width: Integer;
Height: Integer;
Format: TImageFormat;
Size: Integer;
Bits: Pointer;
Palette: Pointer;
end;
TDynArray = array of TImageData;
procedure ModImage(var Img: TImageData);
begin
Img.Width := 128;
Img.Height := 128;
end;
procedure ArrayStuff(const Arr: TDynArray);
var
I: Integer;
begin
for I := 0 to High(Arr) do
ModImage(Arr[I]);
end;
var
MyArr: TDynArray;
begin
SetLength(MyArr, 5);
ArrayStuff(MyArr);
end.
{
bug-interror.pas(30,5) Fatal: Internal error 200106041
bug-interror.pas(30,5) Fatal: Compilation aborted
Error is caused by const parameter in procedure ArrayStuff(const Arr: TDynArray);
Doesn't occur when array is var parameter.
Only crashed in $MODE DELPHI.
Delphi lets you change elements of array even though
array is passed as const parameter.
}