From a6716fd2a2bd9311f9bc1d8f7efff5fbea76801c Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Sun, 29 Nov 2009 21:41:47 +0000 Subject: [PATCH] * fixed calling inherited class methods from category methods when using the iPhoneOS/Mac OS X 10.6 objc runtime interface (tests/test/tobjc25.pp) git-svn-id: trunk@14289 - --- compiler/objcutil.pas | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/compiler/objcutil.pas b/compiler/objcutil.pas index c87542b040..c60c91546c 100644 --- a/compiler/objcutil.pas +++ b/compiler/objcutil.pas @@ -145,8 +145,16 @@ end; if (oo_is_classhelper in tobjectdef(tclassrefdef(def).pointeddef).objectoptions) then begin { in case we are in a category method, we need the metaclass of the - superclass class extended by this category (= metaclass of superclass of superclass) } - result:=cloadvmtaddrnode.create(ctypenode.create(tobjectdef(tclassrefdef(def).pointeddef).childof.childof)); + superclass class extended by this category (= metaclass of superclass of superclass) + for the fragile abi, and the metaclass of the superclass for the non-fragile ABI } +{$if defined(onlymacosx10_6) or defined(arm) } + { NOTE: those send2 methods are only available on Mac OS X 10.6 and later! + (but also on all iPhone SDK revisions we support) } + if (target_info.system in system_objc_nfabi) then + result:=cloadvmtaddrnode.create(ctypenode.create(tobjectdef(tclassrefdef(def).pointeddef).childof)) + else +{$endif onlymacosx10_6 or arm} + result:=cloadvmtaddrnode.create(ctypenode.create(tobjectdef(tclassrefdef(def).pointeddef).childof.childof)); result:=objcloadbasefield(result,'ISA'); typecheckpass(result); { we're done }