summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--embedvar.h1
-rw-r--r--intrpvar.h2
-rw-r--r--regcomp.c11
-rw-r--r--regexec.c21
-rw-r--r--regexp.h7
-rw-r--r--scope.c11
-rw-r--r--scope.h2
-rw-r--r--sv.c14
8 files changed, 2 insertions, 67 deletions
diff --git a/embedvar.h b/embedvar.h
index ee41546a37..523874c7c6 100644
--- a/embedvar.h
+++ b/embedvar.h
@@ -246,7 +246,6 @@
#define PL_reentrant_buffer (vTHX->Ireentrant_buffer)
#define PL_reentrant_retint (vTHX->Ireentrant_retint)
#define PL_reg_curpm (vTHX->Ireg_curpm)
-#define PL_reg_state (vTHX->Ireg_state)
#define PL_regdummy (vTHX->Iregdummy)
#define PL_regex_pad (vTHX->Iregex_pad)
#define PL_regex_padav (vTHX->Iregex_padav)
diff --git a/intrpvar.h b/intrpvar.h
index 32a9983e41..27058d70c3 100644
--- a/intrpvar.h
+++ b/intrpvar.h
@@ -119,8 +119,6 @@ PERLVAR(I, sv_objcount, IV) /* DEPRECATED AND UNMAINTAINED.
PERLVAR(I, sv_root, SV *) /* storage for SVs belonging to interp */
PERLVAR(I, sv_arenaroot, SV *) /* list of areas for garbage collection */
-PERLVAR(I, reg_state, struct re_save_state)
-
/* fake PMOP that PL_curpm points to while in (?{}) so $1 et al are visible */
PERLVARI(I, reg_curpm, PMOP*, NULL)
diff --git a/regcomp.c b/regcomp.c
index 03d5d5070e..9ed451097b 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -15458,17 +15458,6 @@ Perl_save_re_context(pTHX)
{
dVAR;
- struct re_save_state *state;
-
- SAVEVPTR(PL_curcop);
- SSGROW(SAVESTACK_ALLOC_FOR_RE_SAVE_STATE + 1);
-
- state = (struct re_save_state *)(PL_savestack + PL_savestack_ix);
- PL_savestack_ix += SAVESTACK_ALLOC_FOR_RE_SAVE_STATE;
- SSPUSHUV(SAVEt_RE_STATE);
-
- Copy(&PL_reg_state, state, 1, struct re_save_state);
-
/* Save $1..$n (#18107: UTF-8 s/(\w+)/uc($1)/e); AMS 20021106. */
if (PL_curpm) {
const REGEXP * const rx = PM_GETRE(PL_curpm);
diff --git a/regexec.c b/regexec.c
index 449a1e5c9e..eb95d22497 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2821,7 +2821,7 @@ phooey:
}
-/* Set which rex is pointed to by PL_reg_state, handling ref counting.
+/* Set which rex is pointed to by PL_reg_curpm, handling ref counting.
* Do inc before dec, in case old and new rex are the same */
#define SET_reg_curpm(Re2) \
if (reginfo->info_aux_eval) { \
@@ -4836,29 +4836,12 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
OP * const oop = PL_op;
COP * const ocurcop = PL_curcop;
OP *nop;
- struct re_save_state saved_state;
CV *newcv;
/* save *all* paren positions */
regcppush(rex, 0, maxopenparen);
REGCP_SET(runops_cp);
- /* To not corrupt the existing regex state while executing the
- * eval we would normally put it on the save stack, like with
- * save_re_context. However, re-evals have a weird scoping so we
- * can't just add ENTER/LEAVE here. With that, things like
- *
- * (?{$a=2})(a(?{local$a=$a+1}))*aak*c(?{$b=$a})
- *
- * would break, as they expect the localisation to be unwound
- * only when the re-engine backtracks through the bit that
- * localised it.
- *
- * What we do instead is just saving the state in a local c
- * variable.
- */
- Copy(&PL_reg_state, &saved_state, 1, struct re_save_state);
-
if (!caller_cv)
caller_cv = find_runcv(NULL);
@@ -5007,8 +4990,6 @@ S_regmatch(pTHX_ regmatch_info *reginfo, char *startpos, regnode *prog)
}
- Copy(&saved_state, &PL_reg_state, 1, struct re_save_state);
-
/* *** Note that at this point we don't restore
* PL_comppad, (or pop the CxSUB) on the assumption it may
* be used again soon. This is safe as long as nothing
diff --git a/regexp.h b/regexp.h
index 8256c8deeb..5422bd1552 100644
--- a/regexp.h
+++ b/regexp.h
@@ -829,13 +829,6 @@ typedef struct regmatch_slab {
} regmatch_slab;
-struct re_save_state {
- /* temporarily give the struct a member till we delete the whole thing */
- int dummy;
-};
-
-#define SAVESTACK_ALLOC_FOR_RE_SAVE_STATE \
- (1 + ((sizeof(struct re_save_state) - 1) / sizeof(*PL_savestack)))
/*
* Local variables:
diff --git a/scope.c b/scope.c
index 2d3810fb8d..d2ae04a650 100644
--- a/scope.c
+++ b/scope.c
@@ -1225,17 +1225,6 @@ Perl_leave_scope(pTHX_ I32 base)
PL_compiling.cop_warnings = (STRLEN*)ARG0_PTR;
break;
- case SAVEt_RE_STATE:
- {
- const struct re_save_state *const state
- = (struct re_save_state *)
- (PL_savestack + PL_savestack_ix
- - SAVESTACK_ALLOC_FOR_RE_SAVE_STATE);
- PL_savestack_ix -= SAVESTACK_ALLOC_FOR_RE_SAVE_STATE;
-
- Copy(state, &PL_reg_state, 1, struct re_save_state);
- }
- break;
case SAVEt_PARSER:
parser_free((yy_parser *) ARG0_PTR);
break;
diff --git a/scope.h b/scope.h
index 22c728d1be..a9ef5426f7 100644
--- a/scope.h
+++ b/scope.h
@@ -16,7 +16,7 @@
#define SAVEt_CLEARPADRANGE 1
#define SAVEt_CLEARSV 2
#define SAVEt_REGCONTEXT 3
-#define SAVEt_RE_STATE 4
+/*** SPARE 4 ***/
#define SAVEt_ARG0_MAX 4
diff --git a/sv.c b/sv.c
index a56d9bde37..98a6b3646f 100644
--- a/sv.c
+++ b/sv.c
@@ -12889,19 +12889,6 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl, CLONE_PARAMS* param)
sv = (const SV *)POPPTR(ss,ix);
TOPPTR(nss,ix) = sv_dup(sv, param);
break;
- case SAVEt_RE_STATE:
- {
- const struct re_save_state *const old_state
- = (struct re_save_state *)
- (ss + ix - SAVESTACK_ALLOC_FOR_RE_SAVE_STATE);
- struct re_save_state *const new_state
- = (struct re_save_state *)
- (nss + ix - SAVESTACK_ALLOC_FOR_RE_SAVE_STATE);
-
- Copy(old_state, new_state, 1, struct re_save_state);
- ix -= SAVESTACK_ALLOC_FOR_RE_SAVE_STATE;
- break;
- }
case SAVEt_COMPILE_WARNINGS:
ptr = POPPTR(ss,ix);
TOPPTR(nss,ix) = DUP_WARNINGS((STRLEN*)ptr);
@@ -13159,7 +13146,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
#endif
/* RE engine related */
- Zero(&PL_reg_state, 1, struct re_save_state);
PL_regmatch_slab = NULL;
PL_reg_curpm = NULL;