diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-12-28 03:44:10 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-12-28 03:44:10 +0000 |
commit | de0c8cb881313fb53ccecc309c3a182787a8a527 (patch) | |
tree | 3dd2617011981415428ffda5a7a8f36f7bd8c4c9 /regcomp.c | |
parent | f70c35af95b032bef7265d8d8029831a16708010 (diff) | |
download | perl-de0c8cb881313fb53ccecc309c3a182787a8a527.tar.gz |
fix for /(^|a)b/ breakage from Ilya Zakharevich
p4raw-id: //depot/perl@4724
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -545,9 +545,21 @@ S_study_chunk(pTHX_ regnode **scanp, I32 *deltap, regnode *last, scan_data_t *da } } else if (flags & SCF_DO_STCLASS_AND) { - cl_and(data->start_class, &accum); - if (min1) + if (min1) { + cl_and(data->start_class, &accum); flags &= ~SCF_DO_STCLASS; + } + else { + /* Switch to OR mode: cache the old value of + * data->start_class */ + StructCopy(data->start_class, &and_with, + struct regnode_charclass_class); + flags &= ~SCF_DO_STCLASS_AND; + StructCopy(&accum, data->start_class, + struct regnode_charclass_class); + flags |= SCF_DO_STCLASS_OR; + data->start_class->flags |= ANYOF_EOS; + } } } else if (code == BRANCHJ) /* single branch is optimized. */ |