mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 09:28:48 +02:00
* don't give an internal error when creating a dynamic array or a
record that requires init/finalisation with an objcclass (mantis #16366) git-svn-id: trunk@15202 -
This commit is contained in:
parent
99e078985f
commit
0b44f8db1f
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10350,6 +10350,7 @@ tests/webtbs/tw16311.pp svneol=native#text/plain
|
||||
tests/webtbs/tw16326.pp svneol=native#text/plain
|
||||
tests/webtbs/tw16328.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1634.pp svneol=native#text/plain
|
||||
tests/webtbs/tw16366.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1658.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1677.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1681.pp svneol=native#text/plain
|
||||
|
@ -4520,6 +4520,15 @@ implementation
|
||||
result:=inherited rtti_mangledname(rt)
|
||||
else
|
||||
begin
|
||||
{ necessary in case of a dynamic array of nsobject, or
|
||||
if an nsobject field appears in a record that needs
|
||||
init/finalisation }
|
||||
if rt=initrtti then
|
||||
begin
|
||||
result:=voidpointertype.rtti_mangledname(rt);
|
||||
exit;
|
||||
end;
|
||||
|
||||
if not(target_info.system in systems_objc_nfabi) then
|
||||
begin
|
||||
result:=target_asm.labelprefix;
|
||||
|
21
tests/webtbs/tw16366.pp
Normal file
21
tests/webtbs/tw16366.pp
Normal file
@ -0,0 +1,21 @@
|
||||
{ %target=darwin }
|
||||
{ %cpu=powerpc,powerpc64,i386,x86_64,arm }
|
||||
|
||||
{$mode objfpc}
|
||||
{$modeswitch objectivec1}
|
||||
|
||||
type
|
||||
ta = array of nsobject;
|
||||
var
|
||||
a: ta;
|
||||
i: longint;
|
||||
begin
|
||||
setlength(a,5);
|
||||
for i := low(a) to high(a) do
|
||||
begin
|
||||
if a[i]<>nil then
|
||||
halt(1);
|
||||
{ crash if the rtl tries to "finalise" the nsobject elements }
|
||||
a[i]:=nsobject(i*10000+12345);
|
||||
end;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user