#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)
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)
{
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);
}
-/* 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) { \
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);
}
- 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
} 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:
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;
#define SAVEt_CLEARPADRANGE 1
#define SAVEt_CLEARSV 2
#define SAVEt_REGCONTEXT 3
-#define SAVEt_RE_STATE 4
+/*** SPARE 4 ***/
#define SAVEt_ARG0_MAX 4
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);
#endif
/* RE engine related */
- Zero(&PL_reg_state, 1, struct re_save_state);
PL_regmatch_slab = NULL;
PL_reg_curpm = NULL;