Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Wordcode functions with empty bodies



Bart Schaefer wrote:

> On Jun 14,  8:14am, Sven Wischnowsky wrote:
> } Subject: Re: Wordcode functions with empty bodies
> }
> } I had a little debugging session yesterday evening... I could
> } reproduce the segv with the `prompt' thing (although I had to invoke
> } `prompt bart' a second time with some other command before it to make
> } it go kaboom).
> } 
> } I could not, however, see any problems with bld_eprog(). In which way
> } do you think it produces garbled eprogs? (I mean, what do those eprogs 
> } look like?)
> 
> They have a `len' of 4 and a `strs' that points to four bytes of garbage.
> The crashes appear to happen after dupeprog() copies `strs' -- the new
> copy often ends up pointing to a different four bytes of garbage.

I almost thought that you meant this... that's ok, even if it looks
weird. `len' is the total length of the memory block used for
patterns, the word code and the string table. `prog' and `strs' point
into that memory at the rightpositions, `strs' after the word
code. Since there are no strings it points to the memory *after* the
word code... but it will never be used.


Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author