summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/scope.c b/scope.c
index 257330df66..17e5282993 100644
--- a/scope.c
+++ b/scope.c
@@ -1396,12 +1396,10 @@ Perl_leave_scope(pTHX_ I32 base)
if (SvREADONLY(sv))
SvREADONLY_off(sv);
- if (SvOOK(sv)) { /* OOK or HvAUX */
- if (SvTYPE(sv) == SVt_PVHV)
- Perl_hv_kill_backrefs(aTHX_ MUTABLE_HV(sv));
- else
- sv_backoff(sv);
- }
+ if (SvTYPE(sv) == SVt_PVHV && HvHasAUX(sv))
+ Perl_hv_kill_backrefs(aTHX_ MUTABLE_HV(sv));
+ else if(SvOOK(sv))
+ sv_backoff(sv);
if (SvMAGICAL(sv)) {
/* note that backrefs (either in HvAUX or magic)