* 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:
Jonas Maebe 2010-05-02 13:42:03 +00:00
parent 99e078985f
commit 0b44f8db1f
3 changed files with 31 additions and 0 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -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
View 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.