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

Re: Complicated segfault regression



On Sun, 5 Jul 2015 12:06:16 +0100
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> On Fri, 3 Jul 2015 23:11:59 +0100
> Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx> wrote:
> > n->pop has no dcoumentation whatsoever, but the calculation associated
> > with it in 5.0.7 is to do with how much state->pc gets incremented for
> > each case pattern set, not coutning the string.  Why?  No idea.  The
> > calculation has changed, and now looks like the following.
> 
> I've come to the conclusion this has always been wrong, or at least
> confusingly inaccurate.  I think it sort-of worked because the
> comparison landed in the right target area, just not at the right point.

Having said that: the penny has now dropped.  I think it was right, just
incredibly obscure (the equivalent execcase() code was equally obscure
before I tidied it up).

I was wondering why it didn't count 1 for the string expression in the
case (there was only one back then).  But it did... it then subtracted
it off again, because the skip starts at the *next* value of pc after
the one that contained the skip count.  (I've had to subtract that
explicitly --- actually, I simiply remember the next PC as the most
logical way of avoiding funny offsets.)  Then the skip count in the old
case agrees with what the expression was doing, and using the skip count
instead is equivalent in both cases.

So I think everything now adds up.

pws



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