* export DynArrayAssign, resolves #39897

This commit is contained in:
florian 2022-10-06 22:56:38 +02:00
parent ad7cc0e69d
commit 9f293df425
3 changed files with 16 additions and 0 deletions

View File

@ -803,6 +803,9 @@ function DynArraySize(a : pointer): tdynarrayindex;
procedure DynArrayClear(var a: Pointer; typeInfo: Pointer);
external name 'FPC_DYNARRAY_CLEAR';
procedure DynArrayAssign(var dest: Pointer; src: Pointer; typeInfo: pointer);
external name 'FPC_DYNARRAY_ASSIGN';
function DynArrayDim(typeInfo: Pointer): Integer;
begin
result:=0;

View File

@ -39,6 +39,8 @@ function DynArraySize(a : pointer): tdynarrayindex;
procedure DynArrayClear(var a: Pointer; typeInfo: Pointer);
function DynArrayDim(typeInfo: Pointer): Integer;
function DynArrayBounds(a: Pointer; typeInfo: Pointer): TBoundArray;
procedure DynArrayAssign(var dest: Pointer; src: Pointer; typeInfo: pointer);
function IsDynArrayRectangular(a: Pointer; typeInfo: Pointer): Boolean;
function DynArrayIndex(a: Pointer; const indices: array of SizeInt; typeInfo: Pointer): Pointer;

11
tests/webtbs/tw39897.pp Normal file
View File

@ -0,0 +1,11 @@
var
a,b : array of longint;
begin
b:=nil;
SetLength(a,5);
a[1]:=1234;
DynArrayAssign(pointer(b),pointer(a),TypeInfo(a));
if (length(b)<>5) or (b[1]<>1234) then
halt(1);
end.