Change 32757 by [EMAIL PROTECTED] on 2007/12/28 23:17:20
Eliminate prelen from struct regexp. Possibly we are hardcoding a bit
to much, as the replacement assumes that the wrapping string has
exactly 1 character after the wrapped string [specifically ')'].
Affected files ...
... //depot/perl/regcomp.c#626 edit
... //depot/perl/regexp.h#114 edit
Differences ...
==== //depot/perl/regcomp.c#626 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c#625~32756~ 2007-12-28 15:15:47.000000000 -0800
+++ perl/regcomp.c 2007-12-28 15:17:20.000000000 -0800
@@ -4281,7 +4281,6 @@
RXi_SET( r, ri );
r->engine= RE_ENGINE_PTR;
r->refcnt = 1;
- RX_PRELEN(r) = plen;
r->extflags = pm_flags;
{
bool has_p = ((r->extflags & RXf_PMf_KEEPCOPY) ==
RXf_PMf_KEEPCOPY);
==== //depot/perl/regexp.h#114 (text) ====
Index: perl/regexp.h
--- perl/regexp.h#113~32755~ 2007-12-28 14:19:00.000000000 -0800
+++ perl/regexp.h 2007-12-28 15:17:20.000000000 -0800
@@ -98,7 +98,6 @@
/* Information about the match that isn't often used */
- I32 prelen; /* length of precomp */
/* wrapped can't be const char*, as it is returned by sv_2pv_flags */
char *wrapped; /* wrapped version of the pattern */
I32 wraplen; /* length of wrapped */
@@ -355,7 +354,10 @@
/* For source compatibility. We used to store these explicitly. */
#define RX_PRECOMP(prog) ((prog)->wrapped + (prog)->pre_prefix)
-#define RX_PRELEN(prog) ((prog)->prelen)
+/* FIXME? Are we hardcoding too much here and constraining plugin extension
+ writers? Specifically, the value 1 assumes that the wrapped version always
+ has exactly one character at the end, a ')'. Will that always be true? */
+#define RX_PRELEN(prog) ((prog)->wraplen -
(prog)->pre_prefix - 1)
#endif /* PLUGGABLE_RE_EXTENSION */
End of Patch.