bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: locale-dependent assertion failure in gawk 3.1.5


From: Andrew J. Schorr
Subject: Re: locale-dependent assertion failure in gawk 3.1.5
Date: Mon, 10 Jul 2006 09:40:43 -0400
User-agent: Mutt/1.4.2.1i

Hi,

One further question on the topic of wstr caching: in eval.c:r_tree_eval()
in the Node_assign_concat case, the code currently says (in part):

                if (l != r && (l->flags & PERM) == 0 && l->stref == 1) {
                        size_t nlen = l->stlen + r->stlen + 2;

                        erealloc(l->stptr, char *, nlen, "interpret");
                        memcpy(l->stptr + l->stlen, r->stptr, r->stlen);
                        l->stlen += r->stlen;
                        l->stptr[l->stlen] = '\0';
#if defined MBS_SUPPORT
                        if (r->wstptr != NULL)
                                free(r->wstptr);
                        r->wstptr = NULL;
                        r->wstlen = 0;
                        r->flags &= ~WSTRCUR;
#endif /* MBS_SUPPORT */

I have 2 questions:

1. I'm not sure why it is necessary to free r->wstptr; what have we
done to invalidate r's wstr cache?

2. On the other hand, isn't it necessary to free l->wstptr
(if l->flags & WSTRCUR), since we have just changed l->stptr (l's string
value) -- doesn't this invalidate any cached value in l->wstptr?

Regards,
Andy




reply via email to

[Prev in Thread] Current Thread [Next in Thread]