This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
$+ and $^N not always correct on backtracking
authorDavid Mitchell <davem@iabyn.com>
Fri, 25 May 2012 14:03:29 +0000 (15:03 +0100)
committerDavid Mitchell <davem@iabyn.com>
Wed, 13 Jun 2012 12:32:54 +0000 (13:32 +0100)
commitf6033a9d6c91e0c29d5aa5049361a529b5d7cdc4
tree252c0e57180a119bb9dd86d742e6246e3f93f7a2
parent6603fe3e11361247713010ab62a431ccb4ed4641
$+ and $^N not always correct on backtracking

Certain ops (TRIE, BRANCH, CURLYM, CURLY and related) didn't always
correctly restore or update lastcloseparen ($^N) - and sometimes lastparen
($+) - when backtracking, or doing a zero-length match (i.e. A* matching
zero times).

Fix this by saving lastcloseparen and lastparen in the relevant
regmatch_state union sub structs, then restoring as necessary.
regexec.c
regexp.h
t/re/re_tests