summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-13 06:59:57 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-13 06:59:57 +0000
commit959e367355e7dca571e3848d9993f40c66a84fd5 (patch)
tree2cdafaf45978c4665a8f0917f4709ae5e5653f35 /pp_ctl.c
parent24ef60581ee187bb6d4388e124dfc34b8cf0b663 (diff)
downloadperl-959e367355e7dca571e3848d9993f40c66a84fd5.tar.gz
the premature FREETMPS calls in change#1187 weren't defensive enough
p4raw-link: @1187 on //depot/perl: a29cdaf07aa5601e42ae4955cc0f168e91a7c385 p4raw-id: //depot/perl@5699
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 991af23780..4917b02c98 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1848,15 +1848,21 @@ PP(pp_return)
*++newsp = SvREFCNT_inc(*SP);
FREETMPS;
sv_2mortal(*newsp);
- } else {
+ }
+ else {
+ sv = SvREFCNT_inc(*SP); /* FREETMPS could clobber it */
FREETMPS;
- *++newsp = sv_mortalcopy(*SP);
+ *++newsp = sv_mortalcopy(sv);
+ SvREFCNT_dec(sv);
}
- } else
+ }
+ else
*++newsp = (SvTEMP(*SP)) ? *SP : sv_mortalcopy(*SP);
- } else
+ }
+ else
*++newsp = sv_mortalcopy(*SP);
- } else
+ }
+ else
*++newsp = &PL_sv_undef;
}
else if (gimme == G_ARRAY) {