summaryrefslogtreecommitdiff
path: root/regexp.h
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2007-03-21 11:39:24 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-03-22 09:01:37 +0000
commit28d8d7f41ab202dd5f7611033d27ecad44cadd60 (patch)
tree330e1fcd2c3e0573355f25c14fc04ce0e64c608c /regexp.h
parentda140a4068f95cc339e9327c1579a94f9f241dd8 (diff)
downloadperl-28d8d7f41ab202dd5f7611033d27ecad44cadd60.tar.gz
Resolve PL_curpm issues with (??{}) and fix corruption of match results when pattern is a qr.
Message-ID: <9b18b3110703210239x540f5ad9mdb41c2ea6229ac31@mail.gmail.com> plus two follow-up patches (minor tweaks) p4raw-id: //depot/perl@30678
Diffstat (limited to 'regexp.h')
-rw-r--r--regexp.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/regexp.h b/regexp.h
index d12df9209a..9cf324f27f 100644
--- a/regexp.h
+++ b/regexp.h
@@ -31,6 +31,7 @@ struct reg_substr_data;
struct reg_data;
struct regexp_engine;
+struct regexp;
struct reg_substr_datum {
I32 min_offset;
@@ -48,11 +49,19 @@ struct reg_substr_data {
#else
#define SV_SAVED_COPY
#endif
+
+/* swap buffer for paren structs */
+typedef struct regexp_paren_ofs {
+ I32 *startp;
+ I32 *endp;
+} regexp_paren_ofs;
+
/* this is ordered such that the most commonly used
fields are at the start of the struct */
typedef struct regexp {
/* what engine created this regexp? */
const struct regexp_engine* engine;
+ struct regexp* mother_re; /* what re is this a lightweight copy of? */
/* Information about the match that the perl core uses to manage things */
U32 extflags; /* Flags used both externally and internally */
@@ -71,8 +80,10 @@ typedef struct regexp {
/* Data about the last/current match. These are modified during matching*/
U32 lastparen; /* last open paren matched */
U32 lastcloseparen; /* last close paren matched */
+ regexp_paren_ofs *swap; /* Swap copy of *startp / *endp */
I32 *startp; /* Array of offsets from start of string (@-) */
I32 *endp; /* Array of offsets from start of string (@+) */
+
char *subbeg; /* saved or original string
so \digit works forever. */
I32 sublen; /* Length of string pointed by subbeg */
@@ -216,7 +227,6 @@ typedef struct regexp_engine {
#define RXf_TAINTED_SEEN 0x20000000
/* two bits here */
-
#define RX_HAS_CUTGROUP(prog) ((prog)->intflags & PREGf_CUTGROUP_SEEN)
#define RX_MATCH_TAINTED(prog) ((prog)->extflags & RXf_TAINTED_SEEN)
#define RX_MATCH_TAINTED_on(prog) ((prog)->extflags |= RXf_TAINTED_SEEN)