This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
when disabling regex implicit check string we must reset anchored flag
authorYves Orton <demerphq@gmail.com>
Sat, 19 Jun 2010 11:41:10 +0000 (13:41 +0200)
committerYves Orton <demerphq@gmail.com>
Thu, 24 Jun 2010 16:51:40 +0000 (18:51 +0200)
commitc941595168829d86ac7d2e0fa00a891d42f5d96e
tree06b841700980831c832be20f7c038c17b96e358f
parent2c33c7677d07b611b2eedbfa2f6b0b56a17ef91b
when disabling regex implicit check string we must reset anchored flag

It seems that if a regex check string is determined to be "not useful"
it is permananently disabled. However, it appears that when doing this
we dont necessarily reset any flags that are related to it.

Worse, the behaviour is not determinisitic, so it is quite possible that
a given program may experience this bug "randomly" based on what strings
it was matching. Thus it may be difficult to reproduce.

Resetting the RXc_ANCH_MBOL when we know that it is implicit
(PREGf_IMPLICIT) seems to fix /this/ particular example. But it wouldn't
surprise me to discover that other "random" bugs we encounter can be
traced back to this behaviour.

This fixes RT #75878 which is derived from ActiveState Bug #87173.

    http://bugs.activestate.com/show_bug.cgi?id=87173
    http://rt.perl.org/rt3/Ticket/Display.html?id=75878
regexec.c
t/re/pat.t