[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] fix broken slot allocation
From: |
Mikael Djurfeldt |
Subject: |
Re: [PATCH] fix broken slot allocation |
Date: |
Mon, 07 Apr 2003 20:16:39 +0200 |
User-agent: |
Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.2 (gnu/linux) |
Andy Wingo <address@hidden> 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.