*/
#define CHR_SVLEN(sv) (utf8_target ? sv_len_utf8(sv) : SvCUR(sv))
-#define CHR_DIST(a,b) (PL_reg_match_utf8 ? utf8_distance(a,b) : a - b)
+#define CHR_DIST(a,b) (reginfo->is_utf8_target ? utf8_distance(a,b) : a - b)
#define HOPc(pos,off) \
- (char *)(PL_reg_match_utf8 \
+ (char *)(reginfo->is_utf8_target \
? reghop3((U8*)pos, off, \
(U8*)(off >= 0 ? reginfo->strend : reginfo->strbeg)) \
: (U8*)(pos + off))
#define HOPBACKc(pos, off) \
- (char*)(PL_reg_match_utf8\
+ (char*)(reginfo->is_utf8_target \
? reghopmaybe3((U8*)pos, -off, (U8*)(reginfo->strbeg)) \
: (pos - off >= reginfo->strbeg) \
? (U8*)pos - off \
: NULL)
-#define HOP3(pos,off,lim) (PL_reg_match_utf8 ? reghop3((U8*)(pos), off, (U8*)(lim)) : (U8*)(pos + off))
+#define HOP3(pos,off,lim) (reginfo->is_utf8_target ? reghop3((U8*)(pos), off, (U8*)(lim)) : (U8*)(pos + off))
#define HOP3c(pos,off,lim) ((char*)HOP3(pos,off,lim))
PERL_UNUSED_ARG(data);
RX_MATCH_UTF8_set(rx,utf8_target);
- PL_reg_match_utf8 = cBOOL(utf8_target);
+ reginfo->is_utf8_target = cBOOL(utf8_target);
/* CHR_DIST() would be more correct here but it makes things slow. */
if (prog->minlen > strend - strpos) {
U8 c2;
char *e;
I32 tmp = 1; /* Scratch variable? */
- const bool utf8_target = PL_reg_match_utf8;
+ const bool utf8_target = reginfo->is_utf8_target;
UV utf8_fold_flags = 0;
const bool is_utf8_pat = reginfo->is_utf8_pat;
bool to_complement = FALSE; /* Invert the result? Taking the xor of this
reginfo->eval_state = NULL;
reginfo->prog = rx; /* Yes, sorry that this is confusing. */
reginfo->intuit = 0;
+ reginfo->is_utf8_target = cBOOL(utf8_target);
RX_MATCH_UTF8_set(rx, utf8_target);
- PL_reg_match_utf8 = cBOOL(utf8_target);
DEBUG_EXECUTE_r(
debug_start_match(rx, utf8_target, startpos, strend,
* point (unless inappropriately coerced to unsigned). *<c1p> will equal
* *<c2p> if and only if <c1_utf8> and <c2_utf8> are the same. */
- const bool utf8_target = PL_reg_match_utf8;
+ const bool utf8_target = reginfo->is_utf8_target;
UV c1 = CHRTEST_NOT_A_CP_1;
UV c2 = CHRTEST_NOT_A_CP_2;
dMY_CXT;
#endif
dVAR;
- const bool utf8_target = PL_reg_match_utf8;
+ const bool utf8_target = reginfo->is_utf8_target;
const U32 uniflags = UTF8_ALLOW_DEFAULT;
REGEXP *rex_sv = reginfo->prog;
regexp *rex = ReANY(rex_sv);
ST.count++;
/* after first match, determine A's length: u.curlym.alen */
if (ST.count == 1) {
- if (PL_reg_match_utf8) {
+ if (reginfo->is_utf8_target) {
char *s = st->locinput;
while (s < locinput) {
ST.alen++;
I32 c;
char *loceol = reginfo->strend; /* local version */
I32 hardcount = 0; /* How many matches so far */
- bool utf8_target = PL_reg_match_utf8;
+ bool utf8_target = reginfo->is_utf8_target;
int to_complement = 0; /* Invert the result? */
UV utf8_flags;
_char_class_number classnum;
char *cutpoint;
regmatch_eval_state *eval_state; /* extra saved state for (?{}) */
bool intuit; /* re_intuit_start() is the top-level caller */
- bool is_utf8_pat;
+ bool is_utf8_pat; /* regex is utf8 */
+ bool is_utf8_target; /* string being matched is utf8 */
bool warned; /* we have issued a recursion warning; no need for more */
} regmatch_info;
struct regmatch_slab *prev, *next;
} regmatch_slab;
-#define PL_reg_match_utf8 PL_reg_state.re_state_reg_match_utf8
#define PL_reg_curpm PL_reg_state.re_state_reg_curpm
#define PL_reg_maxiter PL_reg_state.re_state_reg_maxiter
#define PL_reg_leftiter PL_reg_state.re_state_reg_leftiter
#define PL_reg_starttry PL_reg_state.re_state_reg_starttry
struct re_save_state {
- bool re_state_reg_match_utf8; /* from regexec.c */
- /* Space for U8 */
I32 re_state_reg_maxiter; /* max wait until caching pos */
I32 re_state_reg_leftiter; /* wait until caching pos */
PMOP *re_state_reg_curpm; /* from regexec.c */