[net.sources] Patch for XLISP version 1.0

betz (04/06/83)

                Patch for XLISP Version 1.0

It turns out that there is a fairly serious problem with the
version  of  'xlobj.c'  that I sent out with the most recent
xlisp distribution.  The problem occurs when a new object is
being  allocated.   The  routine  that allocates the list of
instance  variable  values  for  the  new  object  fails  to
register  the  pointer to the list it is constructing.  This
means that if garbage collection  is  initiated  during  the
process  of  building  the new list, it is possible that the
garbage collector could collect the part of  the  list  that
has already been built.  In order to solve this problem, the
following routine should be inserted into  the  distribution
copy of 'xlobj.c' replacing the routine with the same name.

/* makelist - make a list of nodes */
static struct node *makelist(cnt)
  int cnt;
{
    struct node *oldstk,list,*lnew;

    /* create a new stack frame */
    oldstk = xlsave(&list,NULL);

    /* make the list */
    for (; cnt > 0; cnt--) {
        lnew = newnode(LIST);
        lnew->n_listnext = list.n_ptr;
        list.n_ptr = lnew;
    }

    /* restore the previous stack frame */
    xlstack = oldstk;

    /* return the list */
    return (list.n_ptr);
}

After replacing the 'makelist' routine, 'xlobj.c' should  be
recompiled and xlisp should be relinked.

Sorry about that!

David Betz