* fixed compiler crash when using nested procedures in Objective-C methods

git-svn-id: trunk@14583 -
This commit is contained in:
Jonas Maebe 2010-01-09 15:05:24 +00:00
parent b4058a57ad
commit 77fd8bacc7
3 changed files with 37 additions and 1 deletions

1
.gitattributes vendored
View File

@ -9081,6 +9081,7 @@ tests/test/tobjc30.pp svneol=native#text/plain
tests/test/tobjc30a.pp svneol=native#text/plain
tests/test/tobjc30b.pp svneol=native#text/plain
tests/test/tobjc30c.pp svneol=native#text/plain
tests/test/tobjc31.pp svneol=native#text/plain
tests/test/tobjc4.pp svneol=native#text/plain
tests/test/tobjc4a.pp svneol=native#text/plain
tests/test/tobjc5.pp svneol=native#text/plain

View File

@ -166,7 +166,8 @@ implementation
sl : tpropaccesslist;
begin
if (pd.typ=procdef) and
is_objc_class_or_protocol(tprocdef(pd)._class) then
is_objc_class_or_protocol(tprocdef(pd)._class) and
(pd.parast.symtablelevel=normal_function_level) then
begin
{ insert Objective-C self and selector parameters }
vs:=tparavarsym.create('$_cmd',paranr_objc_cmd,vs_value,objc_seltype,[vo_is_msgsel,vo_is_hidden_para]);

34
tests/test/tobjc31.pp Normal file
View File

@ -0,0 +1,34 @@
{ %target=darwin }
{ %cpu=powerpc,powerpc64,i386,x86_64,arm }
{$mode objfpc}
{$modeswitch objectivec1}
{ test program by saabino80 at alice in Italy for nested procedures in
Objective-C methods }
Program Foo;
uses
ctypes, MacOSAll, CocoaAll;
Type MyObjc= objcclass(NSObject)
Procedure nested; message 'nested';
End;
Procedure MyObjc.nested;
Procedure one;
Begin;
WriteLn('Ciao');
End;
Begin
one;
End;
Var My:MyObjc;
Begin
My := MyObjc.alloc;
My.nested;
My.release;
End.