Skip to content

Commit b4fa55d

Browse files
author
Father Chrysostomos
committed
Gut Perl_save_re_context
What it does is not longer necessary. See ticket #122747 and commits 2c1f00b and 7d75537. The only CPAN module using this function, XML::Fast, passes its tests with this change.
1 parent 57ae61e commit b4fa55d

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed

regcomp.c

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16786,32 +16786,14 @@ S_re_croak2(pTHX_ bool utf8, const char* pat1,const char* pat2,...)
1678616786
Perl_croak(aTHX_ "%"UTF8f, UTF8fARG(utf8, l1-1, buf));
1678716787
}
1678816788

16789-
/* XXX Here's a total kludge. But we need to re-enter for swash routines. */
16789+
/* Get this: We have an empty void function here. But it somehow got into
16790+
the API, so there you go. */
1679016791

1679116792
#ifndef PERL_IN_XSUB_RE
1679216793
void
1679316794
Perl_save_re_context(pTHX)
1679416795
{
16795-
/* Save $1..$n (#18107: UTF-8 s/(\w+)/uc($1)/e); AMS 20021106. */
16796-
if (PL_curpm) {
16797-
const REGEXP * const rx = PM_GETRE(PL_curpm);
16798-
if (rx) {
16799-
U32 i;
16800-
for (i = 1; i <= RX_NPARENS(rx); i++) {
16801-
char digits[TYPE_CHARS(long)];
16802-
const STRLEN len = my_snprintf(digits, sizeof(digits),
16803-
"%lu", (long)i);
16804-
GV *const *const gvp
16805-
= (GV**)hv_fetch(PL_defstash, digits, len, 0);
16806-
16807-
if (gvp) {
16808-
GV * const gv = *gvp;
16809-
if (SvTYPE(gv) == SVt_PVGV && GvSV(gv))
16810-
save_scalar(gv);
16811-
}
16812-
}
16813-
}
16814-
}
16796+
PERL_UNUSED_CONTEXT;
1681516797
}
1681616798
#endif
1681716799

0 commit comments

Comments
 (0)