summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-01-08 17:35:19 +0000
committerNicholas Clark <nick@ccl4.org>2008-01-08 17:35:19 +0000
commit937c6efd46f402a78d44f0b18f0e1e97c6c941d9 (patch)
tree6f750c5bc56551af2606e3efcd57ad9a71d15f51 /sv.c
parent10599a699e18a26ba9c9154ce2c01e7cf53249ce (diff)
downloadperl-937c6efd46f402a78d44f0b18f0e1e97c6c941d9.tar.gz
PL_regex_padav can simply be dup()ed. This is surprisingly satisfying.
p4raw-id: //depot/perl@32901
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/sv.c b/sv.c
index c2b1e1eb35..9268e5659e 100644
--- a/sv.c
+++ b/sv.c
@@ -11256,24 +11256,11 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
PL_regmatch_slab = NULL;
/* Clone the regex array */
- PL_regex_padav = newAV();
- {
- const I32 len = av_len((AV*)proto_perl->Iregex_padav);
- SV* const * const regexen = AvARRAY((AV*)proto_perl->Iregex_padav);
- IV i;
- av_push(PL_regex_padav, sv_dup_inc_NN(regexen[0],param));
- for(i = 1; i <= len; i++) {
- const SV * const regex = regexen[i];
- /* FIXME for plugins
- newSViv(PTR2IV(CALLREGDUPE(
- INT2PTR(REGEXP *, SvIVX(regex)), param))))
- */
- SV * const sv = sv_dup_inc((SV*) regex, param);
- if (SvFLAGS(regex) & SVf_BREAK)
- assert(SvFLAGS(sv) & SVf_BREAK); /* unrefcnted PL_curpm */
- av_push(PL_regex_padav, sv);
- }
- }
+ /* ORANGE FIXME for plugins, probably in the SV dup code.
+ newSViv(PTR2IV(CALLREGDUPE(
+ INT2PTR(REGEXP *, SvIVX(regex)), param))))
+ */
+ PL_regex_padav = av_dup_inc(proto_perl->Iregex_padav, param);
PL_regex_pad = AvARRAY(PL_regex_padav);
/* shortcuts to various I/O objects */