mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 11:24:14 +02:00
+ added test (already works)
git-svn-id: trunk@7771 -
This commit is contained in:
parent
84306f80e9
commit
ba0d0d4bb8
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
49
tests/webtbs/tw9128.pp
Normal 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.
|
||||
}
|
Loading…
Reference in New Issue
Block a user