Re: [pcre-dev] (*THEN) in last alternative

Góra strony
Delete this message
Autor: Philip Hazel
Data:  
Dla: ND
CC: Pcre-dev
Stare tematy: Re: [pcre-dev] (*THEN) in last alternative
Temat: Re: [pcre-dev] (*THEN) in last alternative
On Mon, 21 Mar 2011, ND wrote:

> PCRE version 8.11 2010-12-10
> /\A(?!(?:a(*THEN)b))/
> ac
> No match


There was special code for the final alternative of a non-capturing
parenthesized subpattern. It reduced stack usage by not recursing when
the result of the call would just be passed back from the current level.
However, now that (*THEN) exists, this optimization no longer works,
because the result of the recursive call has to be inspected to see if
(*THEN) was encountered.

I have committed a patch that fixes this bug by removing the
optimization. There was the same bug with the branches of a conditional
subpattern. This has also been fixed.

Philip

--
Philip Hazel