From: Jay Freeman (saurik) <saurik@saurik.com>
Date: Sat, 31 Oct 2009 05:26:02 +0000 (+0000)
Subject: Fixed a stupid bug in message sending that was introduced by GNUstep porting work.
X-Git-Tag: v0.9.432~220
X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/f623c5d85a719968c62ae74d7ef433fdd373dfd0?ds=inline

Fixed a stupid bug in message sending that was introduced by GNUstep porting work.
---

diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm
index 1e6f9b4..a0f9103 100644
--- a/ObjectiveC/Library.mm
+++ b/ObjectiveC/Library.mm
@@ -1894,11 +1894,8 @@ JSValueRef CYSendMessage(apr_pool_t *pool, JSContextRef context, id self, Class
         } CYPoolCatch(NULL)
     }
 
-    objc_super super = {self, _class};
-    void *arg0 = &super;
-
     void *setup[2];
-    setup[0] = &arg0;
+    setup[0] = &self;
     setup[1] = &_cmd;
 
     sig::Signature signature;
@@ -1907,15 +1904,17 @@ JSValueRef CYSendMessage(apr_pool_t *pool, JSContextRef context, id self, Class
     ffi_cif cif;
     sig::sig_ffi_cif(pool, &sig::ObjectiveC, &signature, &cif);
 
-    if (imp == NULL)
+    if (imp == NULL) {
 #ifdef __APPLE__
         if (stret(cif.rtype))
             imp = class_getMethodImplementation_stret(_class, _cmd);
         else
             imp = class_getMethodImplementation(_class, _cmd);
 #else
+        objc_super super = {self, _class};
         imp = objc_msg_lookup_super(&super, _cmd);
 #endif
+    }
 
     void (*function)() = reinterpret_cast<void (*)()>(imp);
     return CYCallFunction(pool, context, 2, setup, count, arguments, initialize, exception, &signature, &cif, function);