summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/scope.c b/scope.c
index 0487ebefbd..98d99a47a2 100644
--- a/scope.c
+++ b/scope.c
@@ -536,7 +536,8 @@ I32 base;
case SAVEt_CLEARSV:
ptr = (void*)&curpad[SSPOPLONG];
sv = *(SV**)ptr;
- if (SvREFCNT(sv) <= 1) { /* Can clear pad variable in place. */
+ /* Can clear pad variable in place? */
+ if (SvREFCNT(sv) <= 1 && !SvOBJECT(sv)) {
if (SvTHINKFIRST(sv)) {
if (SvREADONLY(sv))
croak("panic: leave_scope clearsv");