From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mikael Djurfeldt Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] fix broken slot allocation Date: Mon, 07 Apr 2003 20:16:39 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: References: <20030406115700.GA13339@lark> Reply-To: djurfeldt@nada.kth.se NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1049744249 1995 80.91.224.249 (7 Apr 2003 19:37:29 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 7 Apr 2003 19:37:29 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Apr 07 21:37:28 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 192cQp-0000Vv-00 for ; Mon, 07 Apr 2003 21:37:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 192cNZ-000175-0A for guile-devel@m.gmane.org; Mon, 07 Apr 2003 15:34:05 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 192cGZ-00072Z-00 for guile-devel@gnu.org; Mon, 07 Apr 2003 15:26:51 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 192bpZ-0005Ig-00 for guile-devel@gnu.org; Mon, 07 Apr 2003 14:58:58 -0400 Original-Received: from gnuftp.gnu.org ([199.232.41.6]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 192bWH-0005xQ-00 for guile-devel@gnu.org; Mon, 07 Apr 2003 14:39:01 -0400 Original-Received: from kvast.blakulla.net ([213.212.20.77]) by gnuftp.gnu.org with esmtp (Exim 4.10.13) id 192bFd-0001yA-00 for guile-devel@gnu.org; Mon, 07 Apr 2003 14:21:49 -0400 Original-Received: from dyna224-222.nada.kth.se ([130.237.224.222] helo=linnaeus) by kvast.blakulla.net with esmtp (Exim 3.36 #1 (Debian)) id 192bAf-0002cF-00; Mon, 07 Apr 2003 20:16:41 +0200 Original-Received: from mdj by linnaeus with local (Exim 3.36 #1 (Debian)) id 192bAe-0000TE-00; Mon, 07 Apr 2003 20:16:40 +0200 Original-To: Andy Wingo In-Reply-To: <20030406115700.GA13339@lark> (Andy Wingo's message of "Sun, 6 Apr 2003 12:57:00 +0100") User-Agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.2 (gnu/linux) Original-cc: djurfeldt@nada.kth.se X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2145 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2145 Andy Wingo writes: > You'll probably get my previous message first detailing the problem (I > haven't had internet in a few days, there's some mail sitting in the > queue...). I looked through the sources and came up with a patch -- the > index was not getting updated in the new (as of january, according to > the Changelog) allocation-avoidance code. Seems pretty trivial: > > --- guile-1.6-1.6.3.orig/libguile/goops.c > +++ guile-1.6-1.6.3/libguile/goops.c > @@ -505,12 +505,10 @@ > len = scm_ilength (SCM_CDAR (slots)); > allocation = scm_i_get_keyword (k_allocation, SCM_CDAR (slots), > len, k_instance, FUNC_NAME); > - while (!SCM_EQ_P (allocation, k_instance)) > - { > + if (!SCM_EQ_P (allocation, k_instance)) > + { > slots = SCM_CDR (slots); > - len = scm_ilength (SCM_CDAR (slots)); > - allocation = scm_i_get_keyword (k_allocation, SCM_CDAR (slots), > - len, k_instance, FUNC_NAME); > + continue; > } > type = scm_i_get_keyword (k_class, SCM_CDAR (slots), > len, SCM_BOOL_F, FUNC_NAME); > > The aforementioned problem with guile-gobject goes away when this patch > is applied. Obviously, the original code is buggy. However, your fix is not correct: Slots which don't have instance allocation should not have a corresponding layout entry, so the index should indeed not be updated. Best regards, Mikael D. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel