summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/scope.c b/scope.c
index 673b64cf8b..a53c1c53b0 100644
--- a/scope.c
+++ b/scope.c
@@ -868,6 +868,15 @@ Perl_leave_scope(pTHX_ I32 base)
case SAVEt_CLEARSV:
ptr = (void*)&PL_curpad[SSPOPLONG];
sv = *(SV**)ptr;
+
+ DEBUG_Xv(PerlIO_printf(Perl_debug_log,
+ "Pad [0x%"UVxf"] clearsv: %ld sv=0x%"UVxf"<%"IVdf"> %s\n",
+ PTR2UV(PL_curpad), (long)((SV **)ptr-PL_curpad),
+ PTR2UV(sv),
+ (IV)SvREFCNT(sv),
+ (SvREFCNT(sv) <= 1 && !SvOBJECT(sv)) ? "clear" : "abandon"
+ ));
+
/* Can clear pad variable in place? */
if (SvREFCNT(sv) <= 1 && !SvOBJECT(sv)) {
/*
@@ -1000,7 +1009,7 @@ Perl_leave_scope(pTHX_ I32 base)
PADOFFSET off = (PADOFFSET)SSPOPLONG;
ptr = SSPOPPTR;
if (ptr)
- ((SV**)ptr)[off] = (SV*)SSPOPPTR;
+ ((PAD)ptr)[off] = (SV*)SSPOPPTR;
}
break;
default: