From patchwork Tue Nov 23 19:20:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicola Pero X-Patchwork-Id: 72740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id BEBF2B70D4 for ; Wed, 24 Nov 2010 06:21:51 +1100 (EST) Received: (qmail 8941 invoked by alias); 23 Nov 2010 19:21:36 -0000 Received: (qmail 8921 invoked by uid 22791); 23 Nov 2010 19:21:33 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL, BAYES_00, SARE_SUB_ENC_UTF8, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (140.186.70.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 23 Nov 2010 19:21:18 +0000 Received: from eggs.gnu.org ([140.186.70.92]:46740) by fencepost.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PKyQT-0006v1-LQ for gcc-patches@gnu.org; Tue, 23 Nov 2010 14:21:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PKyQC-0001gg-Iz for gcc-patches@gnu.org; Tue, 23 Nov 2010 14:21:15 -0500 Received: from smtp161.iad.emailsrvr.com ([207.97.245.161]:45439) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PKyQC-0001gM-GW for gcc-patches@gnu.org; Tue, 23 Nov 2010 14:20:56 -0500 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp46.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id F29D8E8A4F for ; Tue, 23 Nov 2010 14:20:55 -0500 (EST) Received: from dynamic10.wm-web.iad.mlsrvr.com (dynamic10.wm-web.iad1a.rsapps.net [192.168.2.217]) by smtp46.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id 74A16E8B32 for ; Tue, 23 Nov 2010 14:20:55 -0500 (EST) Received: from meta-innovation.com (localhost [127.0.0.1]) by dynamic10.wm-web.iad.mlsrvr.com (Postfix) with ESMTP id 44264478807F for ; Tue, 23 Nov 2010 14:20:55 -0500 (EST) Received: by www2.webmail.us (Authenticated sender: nicola.pero@meta-innovation.com, from: nicola.pero@meta-innovation.com) with HTTP; Tue, 23 Nov 2010 20:20:55 +0100 (CET) Date: Tue, 23 Nov 2010 20:20:55 +0100 (CET) Subject: =?UTF-8?Q?libobjc=20-=20minor=20get=5Fimp=20fix?= From: "Nicola Pero" To: "gcc-patches@gnu.org" MIME-Version: 1.0 X-Type: plain Message-ID: <1290540055.277531931@192.168.2.229> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Patch from Richard Frith-Macdonald . Committed to trunk. Thanks Index: sendmsg.c =================================================================== --- sendmsg.c (revision 167090) +++ sendmsg.c (working copy) @@ -189,8 +189,13 @@ get_imp (Class class, SEL sel) /* The dispatch table has been installed, and the method is not in the dispatch table. So the method just doesn't exist for the class. Return the forwarding - implementation. */ - res = __objc_get_forward_imp ((id)class, sel); + implementation. We don't know the receiver (only its + class), so we have to pass 'nil' as the first + argument. Passing the class as first argument is + wrong because the class is not the receiver; it can + result in us calling a class method when we want an + instance method of the same name. */ + res = __objc_get_forward_imp (nil, sel); } } } Index: ChangeLog =================================================================== --- ChangeLog (revision 167090) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2010-11-23 Richard Frith-Macdonald + + * sendmsg.c (get_imp): Fixed call to __objc_get_forward_imp to + pass nil as the receiver since we don't know the receiver at this + point. + 2010-11-18 Nicola Pero * ivars.c: Include stdlib.h.