summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--globvar.sym1
-rw-r--r--regcomp.c16
-rw-r--r--regen/regcomp.pl1
-rw-r--r--regnodes.h13
4 files changed, 15 insertions, 16 deletions
diff --git a/globvar.sym b/globvar.sym
index 243eb3f016..e06a12a18d 100644
--- a/globvar.sym
+++ b/globvar.sym
@@ -58,6 +58,7 @@ PL_ppaddr
PL_reg_extflags_name
PL_reg_intflags_name
PL_reg_name
+PL_reg_off_by_arg
PL_regarglen
PL_regkind
PL_revision
diff --git a/regcomp.c b/regcomp.c
index 476787c64f..253cb78891 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -4396,7 +4396,7 @@ S_join_exact(pTHX_ RExC_state_t *pRExC_state, regnode *scan,
#ifdef EXPERIMENTAL_INPLACESCAN
if (flags && !NEXT_OFF(n)) {
DEBUG_PEEP("atch", val, depth, 0);
- if (reg_off_by_arg[OP(n)]) {
+ if (PL_reg_off_by_arg[OP(n)]) {
ARG_SET(n, val - n);
}
else {
@@ -4656,11 +4656,11 @@ S_rck_elide_nothing(pTHX_ regnode *node)
PERL_ARGS_ASSERT_RCK_ELIDE_NOTHING;
if (OP(node) != CURLYX) {
- const int max = (reg_off_by_arg[OP(node)]
+ const int max = (PL_reg_off_by_arg[OP(node)]
? I32_MAX
/* I32 may be smaller than U16 on CRAYs! */
: (I32_MAX < U16_MAX ? I32_MAX : U16_MAX));
- int off = (reg_off_by_arg[OP(node)] ? ARG(node) : NEXT_OFF(node));
+ int off = (PL_reg_off_by_arg[OP(node)] ? ARG(node) : NEXT_OFF(node));
int noff;
regnode *n = node;
@@ -4675,7 +4675,7 @@ S_rck_elide_nothing(pTHX_ regnode *node)
) {
off += noff;
}
- if (reg_off_by_arg[OP(node)])
+ if (PL_reg_off_by_arg[OP(node)])
ARG(node) = off;
else
NEXT_OFF(node) = off;
@@ -5908,7 +5908,7 @@ S_study_chunk(pTHX_
while ( nxt1 && (OP(nxt1) != WHILEM)) {
regnode *nnxt = regnext(nxt1);
if (nnxt == nxt) {
- if (reg_off_by_arg[OP(nxt1)])
+ if (PL_reg_off_by_arg[OP(nxt1)])
ARG_SET(nxt1, nxt2 - nxt1);
else if (nxt2 - nxt1 < U16_MAX)
NEXT_OFF(nxt1) = nxt2 - nxt1;
@@ -21484,7 +21484,7 @@ S_regtail(pTHX_ RExC_state_t * pRExC_state,
/* Populate this node's next pointer */
assert(val >= scan);
- if (reg_off_by_arg[OP(REGNODE_p(scan))]) {
+ if (PL_reg_off_by_arg[OP(REGNODE_p(scan))]) {
assert((UV) (val - scan) <= U32_MAX);
ARG_SET(REGNODE_p(scan), val - scan);
}
@@ -21583,7 +21583,7 @@ S_regtail_study(pTHX_ RExC_state_t *pRExC_state, regnode_offset p,
(IV)(val - scan)
);
});
- if (reg_off_by_arg[OP(REGNODE_p(scan))]) {
+ if (PL_reg_off_by_arg[OP(REGNODE_p(scan))]) {
assert((UV) (val - scan) <= U32_MAX);
ARG_SET(REGNODE_p(scan), val - scan);
}
@@ -22958,7 +22958,7 @@ Perl_regnext(pTHX_ regnode *p)
(int)OP(p), (int)REGNODE_MAX);
}
- offset = (reg_off_by_arg[OP(p)] ? ARG(p) : NEXT_OFF(p));
+ offset = (PL_reg_off_by_arg[OP(p)] ? ARG(p) : NEXT_OFF(p));
if (offset == 0)
return(NULL);
diff --git a/regen/regcomp.pl b/regen/regcomp.pl
index 3244df398d..cd964df0d3 100644
--- a/regen/regcomp.pl
+++ b/regen/regcomp.pl
@@ -836,7 +836,6 @@ print_typedefs($out);
print_state_defs($out);
print_regkind($out);
print_regarglen($out);
-print_regargvaries($out);
print_reg_off_by_arg($out);
print_reg_name($out);
print_reg_extflags_name($out);
diff --git a/regnodes.h b/regnodes.h
index 8d29900e0c..45cbd071b6 100644
--- a/regnodes.h
+++ b/regnodes.h
@@ -1857,11 +1857,12 @@ EXTCONST U8 PL_regarglen[] = {
#endif /* DOINIT */
-#ifdef REG_COMP_C
+/* PL_reg_off_by_arg[] - Which argument holds the offset to the next node */
-/* reg_off_by_arg[] - Which argument holds the offset to the next node */
-
-static const char reg_off_by_arg[] = {
+#ifndef DOINIT
+EXTCONST U8 PL_reg_off_by_arg[];
+#else
+EXTCONST U8 PL_reg_off_by_arg[] = {
0, /* END */
0, /* SUCCEED */
0, /* SBOL */
@@ -1975,9 +1976,7 @@ static const char reg_off_by_arg[] = {
0, /* PSEUDO */
0, /* REGEX_SET */
};
-
-#endif /* REG_COMP_C */
-
+#endif
/* reg_name[] - Opcode/state names in string form, for debugging */