summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-10-30 16:47:21 +0000
committerDavid Mitchell <davem@iabyn.com>2012-06-13 13:25:51 +0100
commit87a95bcc2d7801f71814a3a5bb160c0bd5b91285 (patch)
treeaad3403fd298d475f4384630c48b874705b5fce0 /regcomp.c
parent8f345207f1de4fd569ad930ffa22666871bb4d04 (diff)
downloadperl-87a95bcc2d7801f71814a3a5bb160c0bd5b91285.tar.gz
regcomp.c: Use no_mg for 2nd fetch of pattern
The pattern could be tied, for example, and so only want to access it once. I couldn't come up with a test case that actually exercised this, but I can think of future changes to regcomp that would. [ this is a re-application by davem of commit 3e0b93e82af0f1a033bcdb918b413113f1d61cf0 ]
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index 14261a7481..6e60737179 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -5209,7 +5209,9 @@ Perl_re_op_compile(pTHX_ SV * const * const patternp, int pat_count,
xend = exp + plen;
}
else {
- exp = (char*)Perl_bytes_to_utf8(aTHX_ (U8*)SvPV(pat, plen), &len);
+ exp = (char*)Perl_bytes_to_utf8(aTHX_
+ (U8*)SvPV_nomg(pat, plen),
+ &len);
xend = exp + len;
SAVEFREEPV(exp);
}