Change 33145 by [EMAIL PROTECTED] on 2008/01/31 10:26:59
Integrate:
[ 32840]
Add RX_UTF8(), which is effectively SvUTF8() but for regexps.
Remove RXp_PRECOMP() and RXp_WRAPPED().
Change the parameter of S_debug_start_match() from regexp to REGEXP.
Change its callers [the only part wrong for 5.10.x]
Affected files ...
... //depot/maint-5.10/perl/embed.fnc#6 integrate
... //depot/maint-5.10/perl/proto.h#4 integrate
... //depot/maint-5.10/perl/regcomp.c#5 integrate
... //depot/maint-5.10/perl/regexec.c#5 integrate
... //depot/maint-5.10/perl/regexp.h#4 integrate
Differences ...
==== //depot/maint-5.10/perl/embed.fnc#6 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#5~33139~ 2008-01-30 15:19:42.000000000 -0800
+++ perl/embed.fnc 2008-01-31 02:26:59.000000000 -0800
@@ -1449,7 +1449,9 @@
# ifdef DEBUGGING
Es |void |dump_exec_pos |NN const char *locinput|NN const regnode
*scan|NN const char *loc_regeol\
|NN const char *loc_bostr|NN const char
*loc_reg_starttry|const bool do_utf8
-Es |void |debug_start_match|NN const regexp *prog|const bool do_utf8|NN
const char *start|NN const char *end|NN const char *blurb
+Es |void |debug_start_match|NN const REGEXP *prog|const bool do_utf8\
+ |NN const char *start|NN const char *end\
+ |NN const char *blurb
# endif
#endif
==== //depot/maint-5.10/perl/proto.h#4 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#3~33139~ 2008-01-30 15:19:42.000000000 -0800
+++ perl/proto.h 2008-01-31 02:26:59.000000000 -0800
@@ -3892,7 +3892,7 @@
__attribute__nonnull__(pTHX_4)
__attribute__nonnull__(pTHX_5);
-STATIC void S_debug_start_match(pTHX_ const regexp *prog, const bool
do_utf8, const char *start, const char *end, const char *blurb)
+STATIC void S_debug_start_match(pTHX_ const REGEXP *prog, const bool
do_utf8, const char *start, const char *end, const char *blurb)
__attribute__nonnull__(pTHX_1)
__attribute__nonnull__(pTHX_3)
__attribute__nonnull__(pTHX_4)
==== //depot/maint-5.10/perl/regcomp.c#5 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c#4~33139~ 2008-01-30 15:19:42.000000000 -0800
+++ perl/regcomp.c 2008-01-31 02:26:59.000000000 -0800
@@ -4292,8 +4292,8 @@
+ (sizeof(STD_PAT_MODS) - 1)
+ (sizeof("(?:)") - 1);
- Newx(RXp_WRAPPED(r), RXp_WRAPLEN(r) + 1, char );
- p = RXp_WRAPPED(r);
+ Newx(RX_WRAPPED(r), RXp_WRAPLEN(r) + 1, char );
+ p = RX_WRAPPED(r);
*p++='('; *p++='?';
if (has_p)
*p++ = KEEPCOPY_PAT_MOD; /*'p'*/
@@ -4794,7 +4794,7 @@
#ifdef STUPID_PATTERN_CHECKS
if (RX_PRELEN(r) == 0)
r->extflags |= RXf_NULL;
- if (r->extflags & RXf_SPLIT && RX_PRELEN(r) == 1 && RXp_PRECOMP(r)[0] == '
')
+ if (r->extflags & RXf_SPLIT && RX_PRELEN(r) == 1 && RX_PRECOMP(r)[0] == '
')
/* XXX: this should happen BEFORE we compile */
r->extflags |= (RXf_SKIPWHITE|RXf_WHITE);
else if (RX_PRELEN(r) == 3 && memEQ("\\s+", RXp_PRECOMP(r), 3))
@@ -4802,7 +4802,7 @@
else if (RX_PRELEN(r) == 1 && RXp_PRECOMP(r)[0] == '^')
r->extflags |= RXf_START_ONLY;
#else
- if (r->extflags & RXf_SPLIT && RXp_PRELEN(r) == 1 && RXp_PRECOMP(r)[0] ==
' ')
+ if (r->extflags & RXf_SPLIT && RXp_PRELEN(r) == 1 && RX_PRECOMP(r)[0] == '
')
/* XXX: this should happen BEFORE we compile */
r->extflags |= (RXf_SKIPWHITE|RXf_WHITE);
else {
@@ -9143,7 +9143,7 @@
CALLREGFREE_PVT(r); /* free the private data */
if (r->paren_names)
SvREFCNT_dec(r->paren_names);
- Safefree(RXp_WRAPPED(r));
+ Safefree(RX_WRAPPED(r));
}
if (r->substrs) {
if (r->anchored_substr)
@@ -9241,7 +9241,7 @@
{
SV *dsv= sv_newmortal();
RE_PV_QUOTED_DECL(s, (r->extflags & RXf_UTF8),
- dsv, RXp_PRECOMP(r), RXp_PRELEN(r), 60);
+ dsv, RX_PRECOMP(r), RXp_PRELEN(r), 60);
PerlIO_printf(Perl_debug_log,"%sFreeing REx:%s %s\n",
PL_colors[4],PL_colors[5],s);
}
@@ -9427,7 +9427,7 @@
precomp_offset = RX_PRECOMP(ret) - ret->wrapped;
- RXp_WRAPPED(ret) = SAVEPVN(RXp_WRAPPED(ret), RXp_WRAPLEN(ret)+1);
+ RX_WRAPPED(ret) = SAVEPVN(RX_WRAPPED(ret), RXp_WRAPLEN(ret)+1);
RX_PRECOMP(ret) = ret->wrapped + precomp_offset;
ret->paren_names = hv_dup_inc(ret->paren_names, param);
==== //depot/maint-5.10/perl/regexec.c#5 (text) ====
Index: perl/regexec.c
--- perl/regexec.c#4~33135~ 2008-01-30 11:50:56.000000000 -0800
+++ perl/regexec.c 2008-01-31 02:26:59.000000000 -0800
@@ -2551,15 +2551,15 @@
#ifdef DEBUGGING
STATIC void
-S_debug_start_match(pTHX_ const regexp *prog, const bool do_utf8,
+S_debug_start_match(pTHX_ const REGEXP *prog, const bool do_utf8,
const char *start, const char *end, const char *blurb)
{
- const bool utf8_pat= prog->extflags & RXf_UTF8 ? 1 : 0;
+ const bool utf8_pat = RX_UTF8(prog) ? 1 : 0;
if (!PL_colorset)
reginitcolors();
{
RE_PV_QUOTED_DECL(s0, utf8_pat, PERL_DEBUG_PAD_ZERO(0),
- RXp_PRECOMP(prog), RXp_PRELEN(prog), 60);
+ RX_PRECOMP(prog), RX_PRELEN(prog), 60);
RE_PV_QUOTED_DECL(s1, do_utf8, PERL_DEBUG_PAD_ZERO(1),
start, end - start, 60);
==== //depot/maint-5.10/perl/regexp.h#4 (text) ====
Index: perl/regexp.h
--- perl/regexp.h#3~33130~ 2008-01-30 09:34:11.000000000 -0800
+++ perl/regexp.h 2008-01-31 02:26:59.000000000 -0800
@@ -360,9 +360,7 @@
? RX_MATCH_COPIED_on(prog) \
: RX_MATCH_COPIED_off(prog))
-#define RXp_PRECOMP(rx) ((rx)->precomp)
#define RXp_PRELEN(rx) ((rx)->prelen)
-#define RXp_WRAPPED(rx) ((rx)->wrapped)
#define RXp_WRAPLEN(rx) ((rx)->wraplen)
#define RXp_EXTFLAGS(rx) ((rx)->extflags)
@@ -414,6 +412,9 @@
#define RX_MATCH_UTF8_set(prog, t) ((t) \
? (RX_MATCH_UTF8_on(prog), (PL_reg_match_utf8 = 1)) \
: (RX_MATCH_UTF8_off(prog), (PL_reg_match_utf8 = 0)))
+
+/* Whether the pattern stored at RX_WRAPPED is in UTF-8 */
+#define RX_UTF8(prog) (RX_EXTFLAGS(prog) & RXf_UTF8)
#define REXEC_COPY_STR 0x01 /* Need to copy the string. */
#define REXEC_CHECKED 0x02 /* check_substr already checked. */
End of Patch.