summaryrefslogtreecommitdiff
path: root/regexp.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-07-25 00:41:07 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-08-25 12:23:59 -0700
commit99a90e5967b33d68a38c309edf24275f1c8a979f (patch)
treecfc8416c25f4661ec9901d4103e77a5f636a2d90 /regexp.h
parent389ecb564541f5a336b531db204970925ed27790 (diff)
downloadperl-99a90e5967b33d68a38c309edf24275f1c8a979f.tar.gz
[perl #116907] Allow //g matching past 2**31 threshold
Change the internal fields for storing positions so that //g in scalar context can move past the 2**31 character threshold. Before this com- mit, the numbers would wrap, resulting in assertion failures. The changes in this commit are only enough to get the added test pass- ing. Stay tuned for more.
Diffstat (limited to 'regexp.h')
-rw-r--r--regexp.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/regexp.h b/regexp.h
index fd6425f403..c8d03e3758 100644
--- a/regexp.h
+++ b/regexp.h
@@ -55,8 +55,8 @@ struct reg_substr_data {
/* offsets within a string of a particular /(.)/ capture */
typedef struct regexp_paren_pair {
- I32 start;
- I32 end;
+ SSize_t start;
+ SSize_t end;
/* 'start_tmp' records a new opening position before the matching end
* has been found, so that the old start and end values are still
* valid, e.g.
@@ -503,7 +503,8 @@ get_regex_charset_name(const U32 flags, STRLEN* const lenp)
#define RX_SAVED_COPY(prog) (ReANY(prog)->saved_copy)
/* last match was zero-length */
#define RX_ZERO_LEN(prog) \
- (RX_OFFS(prog)[0].start + RX_GOFS(prog) == (UV)RX_OFFS(prog)[0].end)
+ (RX_OFFS(prog)[0].start + (SSize_t)RX_GOFS(prog) \
+ == RX_OFFS(prog)[0].end)
#endif /* PLUGGABLE_RE_EXTENSION */