summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-12-01 22:17:55 +0000
committerNicholas Clark <nick@ccl4.org>2008-12-01 22:17:55 +0000
commitfd1b367e716f9d49ad7b9ab14ec9ffbc9065e0bc (patch)
treeb240373da80cded4f539ae5702343b50f761f212 /scope.c
parentefd0b058b26702bef38cdb6ce1a9da02e3e7cf89 (diff)
downloadperl-fd1b367e716f9d49ad7b9ab14ec9ffbc9065e0bc.tar.gz
The temporary SV created in Perl_save_helem_flags() to store the key
can be freed immediately after it is used, as it is unrelated to anything else. This folds SvREFCNT_dec()s on two code paths into one. p4raw-id: //depot/perl@34973
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/scope.c b/scope.c
index 78d796b96d..1e06671647 100644
--- a/scope.c
+++ b/scope.c
@@ -902,19 +902,18 @@ Perl_leave_scope(pTHX_ I32 base)
sv = MUTABLE_SV(SSPOPPTR);
hv = MUTABLE_HV(SSPOPPTR);
ptr = hv_fetch_ent(hv, sv, 1, 0);
+ SvREFCNT_dec(sv);
if (ptr) {
const SV * const oval = HeVAL((HE*)ptr);
if (oval && oval != &PL_sv_undef) {
ptr = &HeVAL((HE*)ptr);
if (SvTIED_mg((const SV *)hv, PERL_MAGIC_tied))
SvREFCNT_inc_void(*(SV**)ptr);
- SvREFCNT_dec(sv);
av = MUTABLE_AV(hv); /* what to refcnt_dec */
goto restore_sv;
}
}
SvREFCNT_dec(hv);
- SvREFCNT_dec(sv);
SvREFCNT_dec(value);
break;
case SAVEt_OP: