summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorArtur Bergman <sky@nanisky.com>2001-09-17 12:44:36 +0000
committerArtur Bergman <sky@nanisky.com>2001-09-17 12:44:36 +0000
commit0f95fc414bfdcbc7a8270650d2028e5494fce075 (patch)
tree8408f3943d59ef19ee337b13452d58004ffe5cfd /sv.c
parentb0cb64b6648430b97dc3cd7a3075e059eb971b16 (diff)
downloadperl-0f95fc414bfdcbc7a8270650d2028e5494fce075.tar.gz
Fixes coredump introduced by 11755 and 11790. Thanks to Doug for
finding it. p4raw-id: //depot/perl@12050
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sv.c b/sv.c
index 48d54228d4..34573537cc 100644
--- a/sv.c
+++ b/sv.c
@@ -9808,12 +9808,18 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
{
I32 len = av_len((AV*)proto_perl->Iregex_padav);
SV** regexen = AvARRAY((AV*)proto_perl->Iregex_padav);
- for(i = 0; i <= len; i++) {
- av_push(PL_regex_padav,
- SvREFCNT_inc(
+ av_push(PL_regex_padav,
+ sv_dup_inc(regexen[0],param));
+ for(i = 1; i <= len; i++) {
+ if(SvREPADTMP(regexen[i])) {
+ av_push(PL_regex_padav, sv_dup_inc(regexen[i], param));
+ } else {
+ av_push(PL_regex_padav,
+ SvREFCNT_inc(
newSViv(PTR2IV(re_dup(INT2PTR(REGEXP *,
SvIVX(regexen[i])), param)))
- ));
+ ));
+ }
}
}
PL_regex_pad = AvARRAY(PL_regex_padav);