On Friday 05 October 2007 14:02:32 [EMAIL PROTECTED] wrote:

> Author: allison
> Date: Fri Oct  5 14:02:31 2007
> New Revision: 21891
>
> Modified:
>    branches/pdd15oo/src/pmc/namespace.pmc
>
> Log:
> [pdd15oo] The namespace PMC adds methods and vtable overrides to the class
> if it's associated with a class.

> Modified: branches/pdd15oo/src/pmc/namespace.pmc
> ===========================================================================
>=== --- branches/pdd15oo/src/pmc/namespace.pmc (original)
> +++ branches/pdd15oo/src/pmc/namespace.pmc    Fri Oct  5 14:02:31 2007
> @@ -182,6 +182,7 @@
>              Parrot_NSInfo *nsinfo    = PARROT_NSINFO(SELF);
>              PMC           *vtable    = nsinfo->vtable;
>              Parrot_sub    *sub       = PMC_sub(value);
> +            PMC * const classobj = VTABLE_get_class(interp, SELF);
>
>              /* Handle vtable methods with two underscores at the start. */
>              if (sub->vtable_index == -1) {
> @@ -202,9 +203,14 @@
>                  /* Insert it. */
>                  VTABLE_set_pmc_keyed_int(INTERP, vtable,
>                      sub->vtable_index, value);
> +
> +                /* Insert it in class, if there is a class */
> +                if (!PMC_IS_NULL(classobj) &&
> PObj_is_class_TEST(classobj)) +                   
> VTABLE_add_vtable_override(interp, classobj, key, value); }

Is there a reason why classobj would *not* be a class if it's not PMCNULL?  I 
don't understand this additional test.

-- c

Reply via email to