reference miscount in Devel::Peek that causes debugger to
Gurusamy Sarathy [Tue, 14 Mar 2000 00:01:39 +0000 (00:01 +0000)]
crash unceremoniously when doing "V DB" etc., repeatedly

p4raw-id: //depot/perl@5716

ext/Devel/Peek/Peek.xs

index e7f5746..9837e9c 100644 (file)
@@ -127,7 +127,7 @@ DeadCode(pTHX)
 
 #define _CvGV(cv)                                      \
        (SvROK(cv) && (SvTYPE(SvRV(cv))==SVt_PVCV)      \
-        ? (SV*)CvGV((CV*)SvRV(cv)) : &PL_sv_undef)
+        ? SvREFCNT_inc(CvGV((CV*)SvRV(cv))) : &PL_sv_undef)
 
 MODULE = Devel::Peek           PACKAGE = Devel::Peek