mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-25 03:41:28 +01:00
* Fixed IE201103063 when <dynamic array of unmanaged type> is being passed to <out open array> parameter.
git-svn-id: trunk@19684 -
This commit is contained in:
parent
dce13ae068
commit
3a579ced7b
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -9766,6 +9766,7 @@ tests/test/talign2.pp svneol=native#text/plain
|
|||||||
tests/test/targ1a.pp svneol=native#text/plain
|
tests/test/targ1a.pp svneol=native#text/plain
|
||||||
tests/test/targ1b.pp svneol=native#text/plain
|
tests/test/targ1b.pp svneol=native#text/plain
|
||||||
tests/test/tarray1.pp svneol=native#text/plain
|
tests/test/tarray1.pp svneol=native#text/plain
|
||||||
|
tests/test/tarray10.pp svneol=native#text/plain
|
||||||
tests/test/tarray2.pp svneol=native#text/plain
|
tests/test/tarray2.pp svneol=native#text/plain
|
||||||
tests/test/tarray3.pp svneol=native#text/plain
|
tests/test/tarray3.pp svneol=native#text/plain
|
||||||
tests/test/tarray4.pp svneol=native#text/plain
|
tests/test/tarray4.pp svneol=native#text/plain
|
||||||
|
|||||||
@ -169,11 +169,16 @@ implementation
|
|||||||
location_get_data_ref(current_asmdata.CurrAsmList,left.location,href,false,sizeof(pint));
|
location_get_data_ref(current_asmdata.CurrAsmList,left.location,href,false,sizeof(pint));
|
||||||
if is_open_array(resultdef) then
|
if is_open_array(resultdef) then
|
||||||
begin
|
begin
|
||||||
if third=nil then
|
{ if elementdef is not managed, omit fpc_decref_array
|
||||||
InternalError(201103063);
|
because it won't do anything anyway }
|
||||||
secondpass(third);
|
if is_managed_type(tarraydef(resultdef).elementdef) then
|
||||||
cg.g_array_rtti_helper(current_asmdata.CurrAsmList,tarraydef(resultdef).elementdef,
|
begin
|
||||||
href,third.location,'FPC_DECREF_ARRAY');
|
if third=nil then
|
||||||
|
InternalError(201103063);
|
||||||
|
secondpass(third);
|
||||||
|
cg.g_array_rtti_helper(current_asmdata.CurrAsmList,tarraydef(resultdef).elementdef,
|
||||||
|
href,third.location,'FPC_DECREF_ARRAY');
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
cg.g_decrrefcount(current_asmdata.CurrAsmList,left.resultdef,href);
|
cg.g_decrrefcount(current_asmdata.CurrAsmList,left.resultdef,href);
|
||||||
|
|||||||
18
tests/test/tarray10.pp
Normal file
18
tests/test/tarray10.pp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{$mode objfpc}{$h+}
|
||||||
|
|
||||||
|
procedure SetArray(out SingleArray: array of Single; const Value: Single);
|
||||||
|
var
|
||||||
|
I: Integer;
|
||||||
|
begin
|
||||||
|
for I := Low(SingleArray) to High(SingleArray) do
|
||||||
|
SingleArray[I] := Value;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
ValuesBuffer: array of Single;
|
||||||
|
|
||||||
|
begin
|
||||||
|
SetLength(ValuesBuffer, 5);
|
||||||
|
{ passing <dynamic array of unmanaged type> to <out open array> should not trigger IE 201103063 }
|
||||||
|
SetArray(ValuesBuffer, 5.7);
|
||||||
|
end.
|
||||||
Loading…
Reference in New Issue
Block a user