diff options
author | Hugo van der Sanden <hv@crypt.org> | 2003-08-07 03:44:23 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-07 05:08:14 +0000 |
commit | c2b0868c4d213b2599daf5fee4d1f957f153bc02 (patch) | |
tree | ecbef8ca9847bd2ac125555b70bd2b79553a6965 /regexec.c | |
parent | 1dd9311ab0a647f516752dd7368cf0b3f3ae13a4 (diff) | |
download | perl-c2b0868c4d213b2599daf5fee4d1f957f153bc02.tar.gz |
Re: [perl #23030] Error in negative lookahead with alternations
Message-Id: <200308070144.h771iN906446@zen.crypt.org>
p4raw-id: //depot/perl@20538
Diffstat (limited to 'regexec.c')
-rw-r--r-- | regexec.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -87,6 +87,7 @@ #define RF_warned 2 /* warned about big count? */ #define RF_evaled 4 /* Did an EVAL with setting? */ #define RF_utf8 8 /* String contains multibyte chars? */ +#define RF_false 16 /* odd number of nested negatives */ #define UTF ((PL_reg_flags & RF_utf8) != 0) @@ -3204,7 +3205,10 @@ S_regmatch(pTHX_ regnode *prog) "%*s already tried at this position...\n", REPORT_CODE_OFF+PL_regindent*2, "") ); - sayNO_SILENT; + if (PL_reg_flags & RF_false) + sayYES; + else + sayNO_SILENT; } PL_reg_poscache[o] |= (1<<b); } @@ -3854,6 +3858,7 @@ S_regmatch(pTHX_ regnode *prog) } else PL_reginput = locinput; + PL_reg_flags ^= RF_false; goto do_ifmatch; case IFMATCH: n = 1; @@ -3869,6 +3874,8 @@ S_regmatch(pTHX_ regnode *prog) do_ifmatch: inner = NEXTOPER(NEXTOPER(scan)); if (regmatch(inner) != n) { + if (n == 0) + PL_reg_flags ^= RF_false; say_no: if (logical) { logical = 0; @@ -3878,6 +3885,8 @@ S_regmatch(pTHX_ regnode *prog) else sayNO; } + if (n == 0) + PL_reg_flags ^= RF_false; say_yes: if (logical) { logical = 0; |