summaryrefslogtreecommitdiff
path: root/regexec.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2013-06-20 14:54:44 +0100
committerDavid Mitchell <davem@iabyn.com>2013-07-28 10:33:36 +0100
commitd058ec57a827a21938e4726983d892ff9054dab3 (patch)
treebb7e22dc40105eb813be92ecb6d711db2004ef20 /regexec.c
parent9c13586e8887c0bcb29d89d3d73a7828043e999c (diff)
downloadperl-d058ec57a827a21938e4726983d892ff9054dab3.tar.gz
pp_match(): skip passing gpos arg to regexec()
In one specific case, pp_match() passes the value of pos() to regexec() via the otherwise unused 'data' arg. It turns out that pp_match() only passes this value when it exists and is >= 0, while regexec() only uses it when there's no pos magic or pos() < 0. So its never used as far as I can tell. So, strip it for now.
Diffstat (limited to 'regexec.c')
-rw-r--r--regexec.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/regexec.c b/regexec.c
index 776f8f0ca4..0b81bab23f 100644
--- a/regexec.c
+++ b/regexec.c
@@ -2203,8 +2203,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
/* sv: SV being matched: only used for utf8 flag, pos() etc; string
* itself is accessed via the pointers above */
/* data: May be used for some additional optimizations.
- Currently its only used, with a U32 cast, for transmitting
- the ganch offset when doing a /g match. This will change */
+ Currently unused. */
/* nosave: For optimizations. */
{
@@ -2394,12 +2393,7 @@ Perl_regexec_flags(pTHX_ REGEXP * const rx, char *stringarg, char *strend,
goto phooey;
}
}
- else if (data) {
- reginfo->ganch = strbeg + PTR2UV(data);
- DEBUG_GPOS_r(PerlIO_printf(Perl_debug_log,
- "GPOS DATA: reginfo->ganch= strbeg + %"UVxf"\n",PTR2UV(data)));
-
- } else { /* pos() not defined */
+ else { /* pos() not defined */
reginfo->ganch = strbeg;
DEBUG_GPOS_r(PerlIO_printf(Perl_debug_log,
"GPOS: reginfo->ganch = strbeg\n"));