mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 11:49:23 +02:00
* fixed compiler crash when using nested procedures in Objective-C methods
git-svn-id: trunk@14583 -
This commit is contained in:
parent
b4058a57ad
commit
77fd8bacc7
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -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
|
||||
|
@ -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
34
tests/test/tobjc31.pp
Normal 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.
|
||||
|
Loading…
Reference in New Issue
Block a user