From: <cod...@go...> - 2009-08-20 22:16:26
|
Revision: 407 Author: wol...@gm... Date: Thu Aug 20 15:15:27 2009 Log: Fix a mixup in sending messages to super on GNUstep: the "self" parameter was passed incorrectly to the superclass method implementation. http://code.google.com/p/hoc/source/detail?r=407 Modified: /trunk/hoc/HOC/HOC/MsgSend.hs ======================================= --- /trunk/hoc/HOC/HOC/MsgSend.hs Mon Aug 17 10:31:23 2009 +++ /trunk/hoc/HOC/HOC/MsgSend.hs Thu Aug 20 15:15:27 2009 @@ -10,7 +10,6 @@ import HOC.FFICallInterface import HOC.Arguments import HOC.Invocation - import Foreign objSendMessageWithRetval @@ -42,7 +41,7 @@ foreign import ccall "objc/objc.h objc_msg_lookup_super" objc_msg_lookup_super :: Ptr ObjCObject -> SEL -> IO (FunPtr ()) - + sndMsgCommon call cif args = do target <- peekElemOff args 0 >>= peek . castPtr selector <- peekElemOff args 1 >>= peek . castPtr @@ -50,10 +49,15 @@ call cif imp args sndMsgSuperCommon call cif args = do - super <- peekElemOff args 0 >>= peek . castPtr - peek (castPtr super) >>= pokeElemOff args 0 + arg0Ptr <- peekElemOff args 0 + super <- peek (castPtr arg0Ptr) + object <- peek (castPtr super) + poke (castPtr arg0Ptr) (object :: Ptr ObjCObject) + selector <- peekElemOff args 1 >>= peek . castPtr + imp <- objc_msg_lookup_super super selector + call cif imp args |