This is a live mirror of the Perl 5 development currently hosted at
https://github.com/perl/perl5
https://perl5.git.perl.org
/
perl5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8a6e5c0
)
Fix (or hide?) a case of memory corruption with \K in substitutions
author
Rafael Garcia-Suarez
<rgarciasuarez@gmail.com>
Wed, 31 Oct 2007 10:15:12 +0000
(10:15 +0000)
committer
Rafael Garcia-Suarez
<rgarciasuarez@gmail.com>
Wed, 31 Oct 2007 10:15:12 +0000
(10:15 +0000)
p4raw-id: //depot/perl@32206
regcomp.c
patch
|
blob
|
blame
|
history
diff --git
a/regcomp.c
b/regcomp.c
index
3ad5d8c
..
7c8c391
100644
(file)
--- a/
regcomp.c
+++ b/
regcomp.c
@@
-6898,6
+6898,11
@@
tryagain:
RExC_seen_zerolen++;
ret = reg_node(pRExC_state, KEEPS);
*flagp |= SIMPLE;
+ /* XXX:dmq : disabling in-place substitution seems to
+ * be necessary here to avoid cases of memory corruption, as
+ * with: C<$_="x" x 80; s/x\K/y/> -- rgs
+ */
+ RExC_seen |= REG_SEEN_LOOKBEHIND;
goto finish_meta_pat;
case 'Z':
ret = reg_node(pRExC_state, SEOL);