From: Nicholas Clark Date: Thu, 31 Jul 2008 10:03:33 +0000 (+0000) Subject: You can't (and shouldn't) use CvDEPTH on a PVFM. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5129b2ca8d01c31a5ccad56604afff370ba7562e;p=p5sagit%2Fp5-mst-13.2.git You can't (and shouldn't) use CvDEPTH on a PVFM. p4raw-id: //depot/perl@34167 --- diff --git a/cv.h b/cv.h index 53c4733..b8f3b09 100644 --- a/cv.h +++ b/cv.h @@ -57,8 +57,7 @@ Returns the stash of the CV. #define CvFILEGV(sv) (gv_fetchfile(CvFILE(sv))) #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) # define CvDEPTH(sv) (*({const CV *_cvdepth = (CV *)sv; \ - assert(SvTYPE(_cvdepth) == SVt_PVCV || \ - SvTYPE(_cvdepth) == SVt_PVFM); \ + assert(SvTYPE(_cvdepth) == SVt_PVCV); \ &((XPVCV*)SvANY(_cvdepth))->xiv_u.xivu_i32; \ })) #else diff --git a/dump.c b/dump.c index 74b5aa1..0613573 100644 --- a/dump.c +++ b/dump.c @@ -1826,7 +1826,8 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo } do_gvgv_dump(level, file, " GVGV::GV", CvGV(sv)); Perl_dump_indent(aTHX_ level, file, " FILE = \"%s\"\n", CvFILE(sv)); - Perl_dump_indent(aTHX_ level, file, " DEPTH = %"IVdf"\n", (IV)CvDEPTH(sv)); + if (type == SVt_PVCV) + Perl_dump_indent(aTHX_ level, file, " DEPTH = %"IVdf"\n", (IV)CvDEPTH(sv)); Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", (UV)CvFLAGS(sv)); Perl_dump_indent(aTHX_ level, file, " OUTSIDE_SEQ = %"UVuf"\n", (UV)CvOUTSIDE_SEQ(sv)); if (type == SVt_PVFM) diff --git a/ext/Devel/Peek/t/Peek.t b/ext/Devel/Peek/t/Peek.t index 43164fd..4fa487a 100644 --- a/ext/Devel/Peek/t/Peek.t +++ b/ext/Devel/Peek/t/Peek.t @@ -654,7 +654,7 @@ do_test(26, XSUBANY = 0 # $] < 5.009 GVGV::GV = $ADDR\\t"main" :: "PIE" FILE = ".*\\b(?i:peek\\.t)" - DEPTH = 0 + DEPTH = 0 # $] <= 5.010 (?: MUTEXP = $ADDR OWNER = $ADDR )? FLAGS = 0x0