From: Nicholas Clark Date: Tue, 8 Jan 2008 17:35:19 +0000 (+0000) Subject: PL_regex_padav can simply be dup()ed. This is surprisingly satisfying. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=937c6efd46f402a78d44f0b18f0e1e97c6c941d9;p=p5sagit%2Fp5-mst-13.2.git PL_regex_padav can simply be dup()ed. This is surprisingly satisfying. p4raw-id: //depot/perl@32901 --- diff --git a/sv.c b/sv.c index c2b1e1e..9268e56 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 */