summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2002-12-28 03:30:49 +0000
committerGurusamy Sarathy <gsar@cpan.org>2002-12-28 03:30:49 +0000
commita5db57d6e186f7924a69b589e2f061c7ee693deb (patch)
treeff204227ffb23679668fbde214cc14b7f58742e5 /regcomp.c
parent92251a1e8193b999333214e50ccc11dd92ebe55e (diff)
downloadperl-a5db57d6e186f7924a69b589e2f061c7ee693deb.tar.gz
save_re_context() was not saving many regexec.c state
variables, resulting in various reentrancy problems when the swatches were autoloaded by perl in the midst of a match p4raw-id: //depot/perl@18358
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/regcomp.c b/regcomp.c
index 7296c484a4..6ecb9787a9 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -5020,20 +5020,6 @@ S_re_croak2(pTHX_ const char* pat1,const char* pat2,...)
void
Perl_save_re_context(pTHX)
{
-#if 0
- SAVEPPTR(RExC_precomp); /* uncompiled string. */
- SAVEI32(RExC_npar); /* () count. */
- SAVEI32(RExC_size); /* Code size. */
- SAVEI32(RExC_flags); /* are we folding, multilining? */
- SAVEVPTR(RExC_rx); /* from regcomp.c */
- SAVEI32(RExC_seen); /* from regcomp.c */
- SAVEI32(RExC_sawback); /* Did we see \1, ...? */
- SAVEI32(RExC_naughty); /* How bad is this pattern? */
- SAVEVPTR(RExC_emit); /* Code-emit pointer; &regdummy = don't */
- SAVEPPTR(RExC_end); /* End of input for compile */
- SAVEPPTR(RExC_parse); /* Input-scan pointer. */
-#endif
-
SAVEI32(PL_reg_flags); /* from regexec.c */
SAVEPPTR(PL_bostr);
SAVEPPTR(PL_reginput); /* String-input pointer. */
@@ -5042,6 +5028,7 @@ Perl_save_re_context(pTHX)
SAVEVPTR(PL_regstartp); /* Pointer to startp array. */
SAVEVPTR(PL_regendp); /* Ditto for endp. */
SAVEVPTR(PL_reglastparen); /* Similarly for lastparen. */
+ SAVEVPTR(PL_reglastcloseparen); /* Similarly for lastcloseparen. */
SAVEPPTR(PL_regtill); /* How far we are required to go. */
SAVEGENERICPV(PL_reg_start_tmp); /* from regexec.c */
PL_reg_start_tmp = 0;
@@ -5063,6 +5050,19 @@ Perl_save_re_context(pTHX)
SAVEI32(PL_reg_oldpos); /* from regexec.c */
SAVEVPTR(PL_reg_oldcurpm); /* from regexec.c */
SAVEVPTR(PL_reg_curpm); /* from regexec.c */
+ SAVEPPTR(PL_reg_oldsaved); /* old saved substr during match */
+ PL_reg_oldsaved = Nullch;
+ SAVEI32(PL_reg_oldsavedlen); /* old length of saved substr during match */
+ PL_reg_oldsavedlen = 0;
+ SAVEI32(PL_reg_maxiter); /* max wait until caching pos */
+ PL_reg_maxiter = 0;
+ SAVEI32(PL_reg_leftiter); /* wait until caching pos */
+ PL_reg_leftiter = 0;
+ SAVEGENERICPV(PL_reg_poscache); /* cache of pos of WHILEM */
+ PL_reg_poscache = Nullch;
+ SAVEI32(PL_reg_poscache_size); /* size of pos cache of WHILEM */
+ PL_reg_poscache_size = 0;
+ SAVEPPTR(PL_regprecomp); /* uncompiled string. */
SAVEI32(PL_regnpar); /* () count. */
SAVEI32(PL_regsize); /* from regexec.c */