summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2013-05-31 22:35:40 +0100
committerDavid Mitchell <davem@iabyn.com>2013-06-02 22:28:55 +0100
commitb3d298be91e6629f3ce52b46c746fbe982114323 (patch)
treeb5f058b39b0863258642a39b7640c007fb43bec3 /regexec.c
parent6d59b6464a160af2e5775a8f6abef1dcad33d7f1 (diff)
downloadperl-b3d298be91e6629f3ce52b46c746fbe982114323.tar.gz
eliminate PL_reg_state
This is a struct that holds all the global state of the current regex match. The previous set of commits have gradually removed all the fields of this struct (by making things local rather than global state). Since the struct is now empty, the PL_reg_state var can be removed, along with the SAVEt_RE_STATE save type which was used to save and restore those fields on recursive re-entry to the regex engine.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c21
1 files changed, 1 insertions, 20 deletions
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